bpf, cpumap: Move xdp:xdp_cpumap_kthread tracepoint before rcv
authorDaniel Xu <dxu@dxuuu.xyz>
Fri, 6 Sep 2024 01:22:44 +0000 (19:22 -0600)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 11 Sep 2024 14:32:11 +0000 (16:32 +0200)
commit23dc9867329c72b48e5039ac93fbf50d9099cdb3
tree9389d70ff28cdf36db750e3c15d703417742a01d
parentd41905b3bb890a32c87b65228b241daad8837fb0
bpf, cpumap: Move xdp:xdp_cpumap_kthread tracepoint before rcv

cpumap takes RX processing out of softirq and onto a separate kthread.
Since the kthread needs to be scheduled in order to run (versus softirq
which does not), we can theoretically experience extra latency if the
system is under load and the scheduler is being unfair to us.

Moving the tracepoint to before passing the skb list up the stack allows
users to more accurately measure enqueue/dequeue latency introduced by
cpumap via xdp:xdp_cpumap_enqueue and xdp:xdp_cpumap_kthread tracepoints.

f9419f7bd7a5 ("bpf: cpumap add tracepoints") which added the tracepoints
states that the intent behind them was for general observability and for
a feedback loop to see if the queues are being overwhelmed. This change
does not mess with either of those use cases but rather adds a third
one.

Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Jesper Dangaard Brouer <hawk@kernel.org>
Link: https://lore.kernel.org/bpf/47615d5b5e302e4bd30220473779e98b492d47cd.1725585718.git.dxu@dxuuu.xyz
kernel/bpf/cpumap.c