selftests/bpf: Add AF_INET packet generation to xdp_metadata
authorLarysa Zaremba <larysa.zaremba@intel.com>
Tue, 5 Dec 2023 21:08:46 +0000 (22:08 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 14 Dec 2023 00:16:41 +0000 (16:16 -0800)
commita3850af4ea25dadc8b35edf132340907d523657e
tree4af552e922f067d4436cbc8afae10a1059821694
parent8e68a4beba943bdffb342c601c649223f44b7329
selftests/bpf: Add AF_INET packet generation to xdp_metadata

The easiest way to simulate stripped VLAN tag in veth is to send a packet
from VLAN interface, attached to veth. Unfortunately, this approach is
incompatible with AF_XDP on TX side, because VLAN interfaces do not have
such feature.

Check both packets sent via AF_XDP TX and regular socket.

AF_INET packet will also have a filled-in hash type (XDP_RSS_TYPE_L4),
unlike AF_XDP packet, so more values can be checked.

Signed-off-by: Larysa Zaremba <larysa.zaremba@intel.com>
Acked-by: Stanislav Fomichev <sdf@google.com>
Link: https://lore.kernel.org/r/20231205210847.28460-18-larysa.zaremba@intel.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/xdp_metadata.c