MTU-tests: BPF-helper did make it upstream and in libbpf

The BPF-helper is now defined in bpf_helper_defs.h header:
 lib/libbpf-install/usr/include/bpf/bpf_helper_defs.h

Update and keep comment as a help for people doing kernel
devel on BPF and want to test BPF-helpers not yet upstream.

Accepted in kernel v5.12
 - commit 34b2021cc616 ("bpf: Add BPF-helper for MTU checking")
 - https://git.kernel.org/torvalds/c/34b2021cc616

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
This commit is contained in:
Jesper Dangaard Brouer
2021-10-26 16:10:57 +02:00
parent d4d325ddfc
commit 635a2f3ca4
+4 -3
View File
@@ -3,13 +3,14 @@
#include <linux/bpf.h>
#include <bpf/bpf_helpers.h>
/* Testing BPF-helper that is not upstream yet, requires us to define
/* When testing a BPF-helper not upstream yet, it is possible to define
* its call signature manually, which will only match our devel kernel.
*
* Generated signatur via command in kernel devel tree:
* ./scripts/bpf_helpers_doc.py --header | grep bpf_check_mtu
* ./scripts/bpf_doc.py --header | grep bpf_check_mtu
*/
static int (*bpf_check_mtu)(void *ctx, __u32 ifindex, __u32 *mtu_len, __s32 len_diff, __u64 flags) = (void *) 163;
// Example:
// static long (*bpf_check_mtu)(void *ctx, __u32 ifindex, __u32 *mtu_len, __s32 len_diff, __u64 flags) = (void *) 163;
enum bpf_check_mtu_flags {
BPF_MTU_CHK_SEGS = (1U << 0),