]> git.baikalelectronics.ru Git - kernel.git/commit
samples/bpf: all XDP samples should unload xdp/bpf prog on SIGTERM
authorJesper Dangaard Brouer <brouer@redhat.com>
Wed, 15 Aug 2018 14:57:14 +0000 (16:57 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 16 Aug 2018 19:55:32 +0000 (21:55 +0200)
commitabe1238a79807f7a8f8d624e9a2b41b41fb877a3
tree8bce921ed07fac52944dbb6d156cc16f62f864b3
parent9e06862c757ce12762d911ce45030e525f2c07d4
samples/bpf: all XDP samples should unload xdp/bpf prog on SIGTERM

It is common XDP practice to unload/deattach the XDP bpf program,
when the XDP sample program is Ctrl-C interrupted (SIGINT) or
killed (SIGTERM).

The samples/bpf programs xdp_redirect_cpu and xdp_rxq_info,
forgot to trap signal SIGTERM (which is the default signal used
by the kill command).

This was discovered by Red Hat QA, which automated scripts depend
on killing the XDP sample program after a timeout period.

Fixes: 9d9fc4d3ce71 ("samples/bpf: add cpumap sample program xdp_redirect_cpu")
Fixes: bd694ea01a71 ("samples/bpf: program demonstrating access to xdp_rxq_info")
Reported-by: Jean-Tsung Hsiao <jhsiao@redhat.com>
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Acked-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
samples/bpf/xdp_redirect_cpu_user.c
samples/bpf/xdp_rxq_info_user.c