selftests/bpf: support BPF_FLOW_DISSECTOR_F_PARSE_1ST_FRAG
authorStanislav Fomichev <sdf@google.com>
Thu, 25 Jul 2019 22:52:29 +0000 (15:52 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 26 Jul 2019 01:00:41 +0000 (18:00 -0700)
commitae173a915785e55574c1fc54edf58b9b87b28c22
treebbbcff28bc66d8eb08c934aad85c14e117dccd17
parent57debff23c4cd47f25850a5f42a903aebe535e95
selftests/bpf: support BPF_FLOW_DISSECTOR_F_PARSE_1ST_FRAG

bpf_flow.c: exit early unless BPF_FLOW_DISSECTOR_F_PARSE_1ST_FRAG is
passed in flags. Also, set ip_proto earlier, this makes sure we have
correct value with fragmented packets.

Add selftest cases to test ipv4/ipv6 fragments and skip eth_get_headlen
tests that don't have BPF_FLOW_DISSECTOR_F_PARSE_1ST_FRAG flag.

eth_get_headlen calls flow dissector with
BPF_FLOW_DISSECTOR_F_PARSE_1ST_FRAG flag so we can't run tests that
have different set of input flags against it.

v2:
 * sefltests -> selftests (Willem de Bruijn)
 * Reword a comment about eth_get_headlen flags (Song Liu)

Acked-by: Petar Penkov <ppenkov@google.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Acked-by: Song Liu <songliubraving@fb.com>
Cc: Song Liu <songliubraving@fb.com>
Cc: Willem de Bruijn <willemb@google.com>
Cc: Petar Penkov <ppenkov@google.com>
Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/flow_dissector.c
tools/testing/selftests/bpf/progs/bpf_flow.c