aboutsummaryrefslogtreecommitdiff
path: root/samples/bpf/xdp_sample_user.h
diff options
context:
space:
mode:
authorKumar Kartikeya Dwivedi2021-08-21 05:50:10 +0530
committerAlexei Starovoitov2021-08-24 14:48:42 -0700
commit594a116b2aa1985dbb5318c2be39b64b74ebff84 (patch)
tree1c2a0c5a39e6f0e4cdc3685e3f98027f580ca48a /samples/bpf/xdp_sample_user.h
parenta29b3ca17ee69e3e5182f1ed29be6b6ec306c149 (diff)
samples: bpf: Convert xdp_redirect_map_multi to XDP samples helper
Use the libbpf skeleton facility and other utilities provided by XDP samples helper. Also adapt to change of type of mac address map, so that no resizing is required. Add a new flag for sample mask that skips priting the from_device->to_device heading for each line, as xdp_redirect_map_multi may have two devices but the flow of data may be bidirectional, so the output would be confusing. 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-23-memxor@gmail.com
Diffstat (limited to 'samples/bpf/xdp_sample_user.h')
-rw-r--r--samples/bpf/xdp_sample_user.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/samples/bpf/xdp_sample_user.h b/samples/bpf/xdp_sample_user.h
index 3a678986cce2..d97465ff8c62 100644
--- a/samples/bpf/xdp_sample_user.h
+++ b/samples/bpf/xdp_sample_user.h
@@ -8,17 +8,18 @@
#include "xdp_sample_shared.h"
enum stats_mask {
- _SAMPLE_REDIRECT_MAP = 1U << 0,
- SAMPLE_RX_CNT = 1U << 1,
- SAMPLE_REDIRECT_ERR_CNT = 1U << 2,
- SAMPLE_CPUMAP_ENQUEUE_CNT = 1U << 3,
- SAMPLE_CPUMAP_KTHREAD_CNT = 1U << 4,
- SAMPLE_EXCEPTION_CNT = 1U << 5,
- SAMPLE_DEVMAP_XMIT_CNT = 1U << 6,
- SAMPLE_REDIRECT_CNT = 1U << 7,
- SAMPLE_REDIRECT_MAP_CNT = SAMPLE_REDIRECT_CNT | _SAMPLE_REDIRECT_MAP,
- SAMPLE_REDIRECT_ERR_MAP_CNT = SAMPLE_REDIRECT_ERR_CNT | _SAMPLE_REDIRECT_MAP,
+ _SAMPLE_REDIRECT_MAP = 1U << 0,
+ SAMPLE_RX_CNT = 1U << 1,
+ SAMPLE_REDIRECT_ERR_CNT = 1U << 2,
+ SAMPLE_CPUMAP_ENQUEUE_CNT = 1U << 3,
+ SAMPLE_CPUMAP_KTHREAD_CNT = 1U << 4,
+ SAMPLE_EXCEPTION_CNT = 1U << 5,
+ SAMPLE_DEVMAP_XMIT_CNT = 1U << 6,
+ SAMPLE_REDIRECT_CNT = 1U << 7,
+ SAMPLE_REDIRECT_MAP_CNT = SAMPLE_REDIRECT_CNT | _SAMPLE_REDIRECT_MAP,
+ SAMPLE_REDIRECT_ERR_MAP_CNT = SAMPLE_REDIRECT_ERR_CNT | _SAMPLE_REDIRECT_MAP,
SAMPLE_DEVMAP_XMIT_CNT_MULTI = 1U << 8,
+ SAMPLE_SKIP_HEADING = 1U << 9,
};
/* Exit return codes */