selftests/bpf: Verify xdp_metadata xdp->af_xdp path
authorStanislav Fomichev <sdf@google.com>
Thu, 19 Jan 2023 22:15:30 +0000 (14:15 -0800)
committerMartin KaFai Lau <martin.lau@kernel.org>
Mon, 23 Jan 2023 17:58:21 +0000 (09:58 -0800)
commite2a46d54d7a100c79c9d645184db9ce594c8f5f6
tree86eb2f6c466a663a56cafe32b29592a22f5aa66f
parent306531f0249f4e1c1aabaa0d70d24a1e9c71e38b
selftests/bpf: Verify xdp_metadata xdp->af_xdp path

- create new netns
- create veth pair (veTX+veRX)
- setup AF_XDP socket for both interfaces
- attach bpf to veRX
- send packet via veTX
- verify the packet has expected metadata at veRX

Cc: John Fastabend <john.fastabend@gmail.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Martin KaFai Lau <martin.lau@linux.dev>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Willem de Bruijn <willemb@google.com>
Cc: Jesper Dangaard Brouer <brouer@redhat.com>
Cc: Anatoly Burakov <anatoly.burakov@intel.com>
Cc: Alexander Lobakin <alexandr.lobakin@intel.com>
Cc: Magnus Karlsson <magnus.karlsson@gmail.com>
Cc: Maryam Tahhan <mtahhan@redhat.com>
Cc: xdp-hints@xdp-project.net
Cc: netdev@vger.kernel.org
Signed-off-by: Stanislav Fomichev <sdf@google.com>
Link: https://lore.kernel.org/r/20230119221536.3349901-12-sdf@google.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
tools/testing/selftests/bpf/DENYLIST.s390x
tools/testing/selftests/bpf/Makefile
tools/testing/selftests/bpf/prog_tests/xdp_metadata.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/xdp_metadata.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/xdp_metadata2.c [new file with mode: 0644]
tools/testing/selftests/bpf/xdp_metadata.h [new file with mode: 0644]