Skip to content

SCX eBPF macro scx_bpf_dsq_insert

v6.13

The scx_bpf_dsq_insert macro handles the renaming of scx_bpf_dispatch to scx_bpf_dsq_insert gracefully.

Definition

#define scx_bpf_dsq_insert(p, dsq_id, slice, enq_flags)             \
    (bpf_ksym_exists(scx_bpf_dsq_insert) ?                 \
     scx_bpf_dsq_insert((p), (dsq_id), (slice), (enq_flags)) :      \
     scx_bpf_dispatch___compat((p), (dsq_id), (slice), (enq_flags)))

Usage

This macro has the same name as the scx_bpf_dsq_insert kfunc, which will cause the pre-processor to emit this macro instead of just the kfunc. It checks at runtime if the kernel has the scx_bpf_dsq_insert kfunc, and if it does, it calls it. If it doesn't, it calls the scx_bpf_dispatch___compat kfunc instead.

These two kfuncs are functionally equivalent, but a rename happened since the name dispatch was overloaded and confusing.

Example

Docs could be improved

This part of the docs is incomplete, contributions are very welcome