]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: test for seg6local End.BPF action
authorMathieu Xhonneux <m.xhonneux@gmail.com>
Sun, 20 May 2018 13:58:17 +0000 (14:58 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 24 May 2018 09:57:36 +0000 (11:57 +0200)
commitbc3fb77ee2649a99c24d0117dd7429bf0110d3d3
tree1a8f1c71e2940bfa52c5780181f876134d1375a1
parent9fce1a7aec1b5b409d66c9bd8711dedc39abb947
selftests/bpf: test for seg6local End.BPF action

Add a new test for the seg6local End.BPF action. The following helpers
are also tested:

- bpf_lwt_push_encap within the LWT BPF IN hook
- bpf_lwt_seg6_action
- bpf_lwt_seg6_adjust_srh
- bpf_lwt_seg6_store_bytes

A chain of End.BPF actions is built. The SRH is injected through a LWT
BPF IN hook before entering this chain. Each End.BPF action validates
the previous one, otherwise the packet is dropped. The test succeeds
if the last node in the chain receives the packet and the UDP datagram
contained can be retrieved from userspace.

Signed-off-by: Mathieu Xhonneux <m.xhonneux@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/include/uapi/linux/bpf.h
tools/testing/selftests/bpf/Makefile
tools/testing/selftests/bpf/bpf_helpers.h
tools/testing/selftests/bpf/test_lwt_seg6local.c [new file with mode: 0644]
tools/testing/selftests/bpf/test_lwt_seg6local.sh [new file with mode: 0755]