OSDN Git Service

selftests/bpf: Convert test_flow_dissector to use BPF skeleton
authorJakub Sitnicki <jakub@cloudflare.com>
Sun, 31 May 2020 08:28:45 +0000 (10:28 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 1 Jun 2020 22:21:03 +0000 (15:21 -0700)
commitb4b8a3bf9ef0fbbf343b624d68ea328dd4edd5c4
treeeaf9771a8c2940eaaae4cb817fd602c306813f53
parentb8215dce7dfd817ca38807f55165bf502146cd68
selftests/bpf: Convert test_flow_dissector to use BPF skeleton

Switch flow dissector test setup from custom BPF object loader to BPF
skeleton to save boilerplate and prepare for testing higher-level API for
attaching flow dissector with bpf_link.

To avoid depending on program order in the BPF object when populating the
flow dissector PROG_ARRAY map, change the program section names to contain
the program index into the map. This follows the example set by tailcall
tests.

Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200531082846.2117903-12-jakub@cloudflare.com
tools/testing/selftests/bpf/prog_tests/flow_dissector.c
tools/testing/selftests/bpf/progs/bpf_flow.c