summaryrefslogtreecommitdiff
path: root/samples/bpf/xdp_sample_user.c
diff options
context:
space:
mode:
authorKumar Kartikeya Dwivedi <memxor@gmail.com>2021-08-21 03:20:10 +0300
committerAlexei Starovoitov <ast@kernel.org>2021-08-25 00:48:42 +0300
commit594a116b2aa1985dbb5318c2be39b64b74ebff84 (patch)
tree1c2a0c5a39e6f0e4cdc3685e3f98027f580ca48a /samples/bpf/xdp_sample_user.c
parenta29b3ca17ee69e3e5182f1ed29be6b6ec306c149 (diff)
downloadlinux-594a116b2aa1985dbb5318c2be39b64b74ebff84.tar.xz
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.c')
-rw-r--r--samples/bpf/xdp_sample_user.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/samples/bpf/xdp_sample_user.c b/samples/bpf/xdp_sample_user.c
index eb484c15492d..b32d82178199 100644
--- a/samples/bpf/xdp_sample_user.c
+++ b/samples/bpf/xdp_sample_user.c
@@ -1510,7 +1510,7 @@ static int sample_timer_cb(int timerfd, struct stats_record **rec,
if (ret < 0)
return ret;
- if (sample_xdp_cnt == 2) {
+ if (sample_xdp_cnt == 2 && !(sample_mask & SAMPLE_SKIP_HEADING)) {
char fi[IFNAMSIZ];
char to[IFNAMSIZ];
const char *f, *t;