alistair23-linux/tools
Andrey Ignatov 5ecd8c2273 selftests/bpf: Selftest for bpf_skb_ancestor_cgroup_id
Add selftests for bpf_skb_ancestor_cgroup_id helper.

test_skb_cgroup_id.sh prepares testing interface and adds tc qdisc and
filter for it using BPF object compiled from test_skb_cgroup_id_kern.c
program.

BPF program in test_skb_cgroup_id_kern.c gets ancestor cgroup id using
the new helper at different levels of cgroup hierarchy that skb belongs
to, including root level and non-existing level, and saves it to the map
where the key is the level of corresponding cgroup and the value is its
id.

To trigger BPF program, user space program test_skb_cgroup_id_user is
run. It adds itself into testing cgroup and sends UDP datagram to
link-local multicast address of testing interface. Then it reads cgroup
ids saved in kernel for different levels from the BPF map and compares
them with those in user space. They must be equal for every level of
ancestry.

Example of run:
  # ./test_skb_cgroup_id.sh
  Wait for testing link-local IP to become available ... OK
  Note: 8 bytes struct bpf_elf_map fixup performed due to size mismatch!
  [PASS]

Signed-off-by: Andrey Ignatov <rdna@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2018-08-13 01:02:40 +02:00
..
accounting
arch tools arch: Update arch/x86/lib/memcpy_64.S copy used in 'perf bench mem memcpy' 2018-07-30 12:36:51 -03:00
bpf Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2018-08-07 11:02:05 -07:00
build Merge ra.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux 2018-07-20 21:17:12 -07:00
cgroup
firewire
gpio
hv
iio
include bpf: Sync bpf.h to tools/ 2018-08-13 01:02:39 +02:00
kvm/kvm_stat
laptop
leds
lib bpf: Test BPF_PROG_TYPE_SK_REUSEPORT 2018-08-11 01:58:46 +02:00
memory-model
nfsd
objtool objtool: Use '.strtab' if '.shstrtab' doesn't exist, to support ORC tables on Clang 2018-07-14 14:59:42 +02:00
pci
pcmcia
perf perf tools: Fix the build on the alpine:edge distro 2018-07-30 13:15:03 -03:00
power Merge branch 'turbostat' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux 2018-07-29 12:37:55 +02:00
scripts
spi
testing selftests/bpf: Selftest for bpf_skb_ancestor_cgroup_id 2018-08-13 01:02:40 +02:00
thermal/tmon
time
usb tools: usb: ffs-test: Fix build on big endian systems 2018-07-17 10:12:51 +03:00
virtio tools/virtio: add kmalloc_array stub 2018-07-27 16:54:40 +03:00
vm mm: mark pages in use for page tables 2018-06-07 17:34:37 -07:00
wmi
Makefile