selftests/bpf: Add test for bpf_get_link_xdp_id
authorAndrey Ignatov <rdna@fb.com>
Tue, 7 Apr 2020 05:09:46 +0000 (22:09 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 7 Apr 2020 23:35:24 +0000 (01:35 +0200)
commiteb203f4b89c1a1a779d9781e49b568d2a712abc6
tree57c44245c09f97a5267d390fe641fa8ab134cff5
parentf07cbad29741407ace2a9688548fa93d9cb38df3
selftests/bpf: Add test for bpf_get_link_xdp_id

Add xdp_info selftest that makes sure that bpf_get_link_xdp_id returns
valid prog_id for different input modes:

  * w/ and w/o flags when no program is attached;
  * w/ and w/o flags when one program is attached.

Signed-off-by: Andrey Ignatov <rdna@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/2a9a6d1ce33b91ccc1aa3de6dba2d309f2062811.1586236080.git.rdna@fb.com
tools/testing/selftests/bpf/prog_tests/xdp_info.c [new file with mode: 0644]