selftests/bpf: Tests using bpf_check_mtu BPF-helper input mtu_len param
authorJesper Dangaard Brouer <brouer@redhat.com>
Mon, 8 Mar 2021 14:59:23 +0000 (15:59 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 8 Mar 2021 21:45:56 +0000 (22:45 +0100)
commite5e010a3063ad801cb3f85793cbada9c2a654e40
tree30f422e6b5bc6ec5c171d11851ee679ead594ec8
parente5e35e754c28724d5c619f2ec805fd221f8d59ce
selftests/bpf: Tests using bpf_check_mtu BPF-helper input mtu_len param

Add tests that use mtu_len as input parameter in BPF-helper
bpf_check_mtu().

The BPF-helper is avail from both XDP and TC context. Add two tests
per context, one that tests below MTU and one that exceeds the MTU.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/bpf/161521556358.3515614.5915221479709358964.stgit@firesoul
tools/testing/selftests/bpf/prog_tests/check_mtu.c
tools/testing/selftests/bpf/progs/test_check_mtu.c