From: Lucas Siba 2019-04-20 11:40 UTC <@> Date: Sat, 20 Apr 2019 19:06:18 +0000 (-0700) Subject: Update tc-bpf.8 man page examples X-Git-Tag: v5.2.0~45^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d9e90f36b3f92644ed5c915758b403953727e40;p=thirdparty%2Fiproute2.git Update tc-bpf.8 man page examples This patch updates the tc-bpf.8 example application for changes to the struct bpf_elf_map definition. In it's current form, things compile, but the resulting object file is rejected by the verifier when attempting to load it through tc. Signed-off-by: Lucas Siba Signed-off-by: David Ahern [ dropped the unnecessary flags initialization on commit ] --- diff --git a/man/man8/tc-bpf.8 b/man/man8/tc-bpf.8 index b2f9344f5..e4f68aaa7 100644 --- a/man/man8/tc-bpf.8 +++ b/man/man8/tc-bpf.8 @@ -597,6 +597,7 @@ struct bpf_elf_map __section("maps") map_stats = { .size_key = sizeof(uint32_t), .size_value = sizeof(struct tuple), .max_elem = BPF_MAX_MARK, + .pinning = PIN_GLOBAL_NS, }; static inline void cls_update_stats(const struct __sk_buff *skb, @@ -709,13 +710,22 @@ in both examples was: #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) -/* Used map structure */ +/* Object pinning settings */ +#define PIN_NONE 0 +#define PIN_OBJECT_NS 1 +#define PIN_GLOBAL_NS 2 + +/* ELF map definition */ struct bpf_elf_map { __u32 type; __u32 size_key; __u32 size_value; __u32 max_elem; + __u32 flags; __u32 id; + __u32 pinning; + __u32 inner_id; + __u32 inner_idx; }; /* Some used BPF function calls. */