diff options
author | Magnus Karlsson <magnus.karlsson@intel.com> | 2023-07-19 15:24:16 +0200 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2023-07-19 09:56:50 -0700 |
commit | f540d44e05cf2f324697ba375235da2d7c92743c (patch) | |
tree | 00de72aca37ada0a735baa63047f387dcff86d15 /tools/testing/selftests/bpf/progs/xsk_xdp_progs.c | |
parent | 17f1034dd76d7465d4c0948c5280c6fc64ee0542 (diff) | |
download | linux-stable-f540d44e05cf2f324697ba375235da2d7c92743c.tar.gz linux-stable-f540d44e05cf2f324697ba375235da2d7c92743c.tar.bz2 linux-stable-f540d44e05cf2f324697ba375235da2d7c92743c.zip |
selftests/xsk: add basic multi-buffer test
Add the first basic multi-buffer test that sends a stream of 9K
packets and validates that they are received at the other end. In
order to enable sending and receiving multi-buffer packets, code that
sets the MTU is introduced as well as modifications to the XDP
programs so that they signal that they are multi-buffer enabled.
Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
Link: https://lore.kernel.org/r/20230719132421.584801-20-maciej.fijalkowski@intel.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/xsk_xdp_progs.c')
-rw-r--r-- | tools/testing/selftests/bpf/progs/xsk_xdp_progs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/testing/selftests/bpf/progs/xsk_xdp_progs.c b/tools/testing/selftests/bpf/progs/xsk_xdp_progs.c index a630c95c7471..ac76e7363776 100644 --- a/tools/testing/selftests/bpf/progs/xsk_xdp_progs.c +++ b/tools/testing/selftests/bpf/progs/xsk_xdp_progs.c @@ -15,12 +15,12 @@ struct { static unsigned int idx; int count = 0; -SEC("xdp") int xsk_def_prog(struct xdp_md *xdp) +SEC("xdp.frags") int xsk_def_prog(struct xdp_md *xdp) { return bpf_redirect_map(&xsk, 0, XDP_DROP); } -SEC("xdp") int xsk_xdp_drop(struct xdp_md *xdp) +SEC("xdp.frags") int xsk_xdp_drop(struct xdp_md *xdp) { /* Drop every other packet */ if (idx++ % 2) |