]> git.baikalelectronics.ru Git - kernel.git/commit
samples: bpf: Add BPF support for cpumap tracepoints
authorKumar Kartikeya Dwivedi <memxor@gmail.com>
Sat, 21 Aug 2021 00:19:56 +0000 (05:49 +0530)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 24 Aug 2021 21:48:41 +0000 (14:48 -0700)
commitd56a857444ad9b38920ea357bdb3a52976c6d09c
treed67677135ba59e0b9cf4614f11704f075d52e815
parentb2f1aed16d14ca3770e3a633a33f6e250ba3a3d0
samples: bpf: Add BPF support for cpumap tracepoints

These are invoked in two places, when the XDP frame or SKB (for generic
XDP) enqueued to the ptr_ring (cpumap_enqueue) and when kthread processes
the frame after invoking the CPUMAP program for it (returning stats for
the batch).

We use cpumap_map_id to filter on the map_id as a way to avoid printing
incorrect stats for parallel sessions of xdp_redirect_cpu.

Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20210821002010.845777-9-memxor@gmail.com
samples/bpf/xdp_sample.bpf.c