* [PATCH mptcp-next v2 0/2] fix libbpf 0.7 deprecated warnings
@ 2022-02-28 14:32 Geliang Tang
2022-02-28 14:32 ` [PATCH mptcp-next v2 1/2] bpf: examples: static library link to libbpf Geliang Tang
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Geliang Tang @ 2022-02-28 14:32 UTC (permalink / raw)
To: mptcp; +Cc: Geliang Tang
v2:
- update the Makefile as Mat suggested.
Geliang Tang (2):
bpf: examples: static library link to libbpf
bpf: examples: fix libbpf 0.7 deprecated warnings
bpf/examples/Makefile | 4 ++--
bpf/examples/loader.c | 4 ++--
bpf/examples/mptcp_set_sf_sockopt_kern.c | 12 ++++++------
3 files changed, 10 insertions(+), 10 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH mptcp-next v2 1/2] bpf: examples: static library link to libbpf 2022-02-28 14:32 [PATCH mptcp-next v2 0/2] fix libbpf 0.7 deprecated warnings Geliang Tang @ 2022-02-28 14:32 ` Geliang Tang 2022-02-28 14:32 ` [PATCH mptcp-next v2 2/2] bpf: examples: fix libbpf 0.7 deprecated warnings Geliang Tang 2022-03-01 10:06 ` [PATCH mptcp-next v2 0/2] " Matthieu Baerts 2 siblings, 0 replies; 4+ messages in thread From: Geliang Tang @ 2022-02-28 14:32 UTC (permalink / raw) To: mptcp; +Cc: Geliang Tang Change the dynamic libbpf function library link of this BPF examples into a static function library link, so that it no longer depends on the libbpf installed systemwide, but on the latest version of libbpf in a given kernel tree. Signed-off-by: Geliang Tang <geliang.tang@suse.com> --- bpf/examples/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bpf/examples/Makefile b/bpf/examples/Makefile index ff5d1a1ff939..32000cfc72d5 100644 --- a/bpf/examples/Makefile +++ b/bpf/examples/Makefile @@ -5,7 +5,7 @@ CFLAGS += -I${MPTCP}/tools/lib CFLAGS += -I${MPTCP}/tools/include CFLAGS += -I${MPTCP}/tools/perf -LOADER_FLAGS := -lelf -lbpf +LOADER_FLAGS := -lelf -lz ${MPTCP}/tools/lib/bpf/libbpf.a LOADER_FLAGS += -DHAVE_ATTR_TEST=0 BPF_FLAGS := -O2 -target bpf -g @@ -13,7 +13,7 @@ BPF_FLAGS := -O2 -target bpf -g all: loader mptcp_set_sf_sockopt_kern.o loader: - @clang $(CFLAGS) $(LOADER_FLAGS) -o loader loader.c + @clang $(CFLAGS) -o loader loader.c $(LOADER_FLAGS) mptcp_set_sf_sockopt_kern.o: @clang $(BPF_FLAGS) -c mptcp_set_sf_sockopt_kern.c \ -- 2.34.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH mptcp-next v2 2/2] bpf: examples: fix libbpf 0.7 deprecated warnings 2022-02-28 14:32 [PATCH mptcp-next v2 0/2] fix libbpf 0.7 deprecated warnings Geliang Tang 2022-02-28 14:32 ` [PATCH mptcp-next v2 1/2] bpf: examples: static library link to libbpf Geliang Tang @ 2022-02-28 14:32 ` Geliang Tang 2022-03-01 10:06 ` [PATCH mptcp-next v2 0/2] " Matthieu Baerts 2 siblings, 0 replies; 4+ messages in thread From: Geliang Tang @ 2022-02-28 14:32 UTC (permalink / raw) To: mptcp; +Cc: Geliang Tang This patch fixed the following deprecated warnings: loader.c:136:10: warning: 'bpf_program__next' is deprecated: libbpf v0.7+: use bpf_object__next_program() instead [-Wdeprecated-declarations] prog = bpf_program__next(prog, object_file); ^ tools/lib/bpf/libbpf.h:265:12: note: 'bpf_program__next' has been explicitly marked deprecated here LIBBPF_API LIBBPF_DEPRECATED_SINCE(0, 7, "use bpf_object__next_program() instead") ^ tools/lib/bpf/libbpf_common.h:24:4: note: expanded from macro 'LIBBPF_DEPRECATED_SINCE' (LIBBPF_DEPRECATED("libbpf v" # major "." # minor "+: " msg)) ^ tools/lib/bpf/libbpf_common.h:19:47: note: expanded from macro 'LIBBPF_DEPRECATED' ^ loader.c:139:18: warning: 'bpf_program__title' is deprecated: BPF program title is confusing term; please use bpf_program__section_name() instead [-Wdeprecated-declarations] name = (char*) bpf_program__title(prog, false); ^ tools/lib/bpf/libbpf.h:294:12: note: 'bpf_program__title' has been explicitly marked deprecated here LIBBPF_API LIBBPF_DEPRECATED("BPF program title is confusing term; please use bpf_program__section_name() instead") ^ tools/lib/bpf/libbpf_common.h:19:47: note: expanded from macro 'LIBBPF_DEPRECATED' ^ 2 warnings generated. mptcp_set_sf_sockopt_kern.c:19:8: warning: 'bpf_map_def' is deprecated: use BTF-defined maps in .maps section [-Wdeprecated-declarations] struct bpf_map_def SEC("maps") mptcp_sf = { ^ tools/lib/bpf/bpf_helpers.h:136:18: note: 'bpf_map_def' has been explicitly marked deprecated here } __attribute__((deprecated("use BTF-defined maps in .maps section"))); ^ 1 warning generated. Signed-off-by: Geliang Tang <geliang.tang@suse.com> --- bpf/examples/loader.c | 4 ++-- bpf/examples/mptcp_set_sf_sockopt_kern.c | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bpf/examples/loader.c b/bpf/examples/loader.c index 6a87aa9555c8..c4f8e85585b5 100644 --- a/bpf/examples/loader.c +++ b/bpf/examples/loader.c @@ -133,10 +133,10 @@ int main(int argc, const char **argv) LIBBPF_ERROR_WRAPPER(ret, "failed to load programs from object file"); do { - prog = bpf_program__next(prog, object_file); + prog = bpf_object__next_program(object_file, prog); if (!prog) break; - name = (char*) bpf_program__title(prog, false); + name = (char *)bpf_program__section_name(prog); switch(bpf_program__get_expected_attach_type(prog)) { case BPF_CGROUP_SOCK_OPS: diff --git a/bpf/examples/mptcp_set_sf_sockopt_kern.c b/bpf/examples/mptcp_set_sf_sockopt_kern.c index 4079ce197e83..6c8231d21ad8 100644 --- a/bpf/examples/mptcp_set_sf_sockopt_kern.c +++ b/bpf/examples/mptcp_set_sf_sockopt_kern.c @@ -16,12 +16,12 @@ char _license[] SEC("license") = "GPL"; char cc [TCP_CA_NAME_MAX] = "vegas"; /* Associate a subflow counter to each token */ -struct bpf_map_def SEC("maps") mptcp_sf = { - .type = BPF_MAP_TYPE_HASH, - .key_size = sizeof(__u32), - .value_size = sizeof(__u32), - .max_entries = 100 -}; +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __uint(key_size, sizeof(__u32)); + __uint(value_size, sizeof(__u32)); + __uint(max_entries, 100); +} mptcp_sf SEC(".maps"); #define DEBUG 1 -- 2.34.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH mptcp-next v2 0/2] fix libbpf 0.7 deprecated warnings 2022-02-28 14:32 [PATCH mptcp-next v2 0/2] fix libbpf 0.7 deprecated warnings Geliang Tang 2022-02-28 14:32 ` [PATCH mptcp-next v2 1/2] bpf: examples: static library link to libbpf Geliang Tang 2022-02-28 14:32 ` [PATCH mptcp-next v2 2/2] bpf: examples: fix libbpf 0.7 deprecated warnings Geliang Tang @ 2022-03-01 10:06 ` Matthieu Baerts 2 siblings, 0 replies; 4+ messages in thread From: Matthieu Baerts @ 2022-03-01 10:06 UTC (permalink / raw) To: Geliang Tang, mptcp Hi Geliang, On 28/02/2022 15:32, Geliang Tang wrote: > v2: > - update the Makefile as Mat suggested. > > Geliang Tang (2): > bpf: examples: static library link to libbpf > bpf: examples: fix libbpf 0.7 deprecated warnings Thank you for these two patches! Just applied in our repo ("scripts" branch)! While at it, I added a few other small patches cleaning up the Makefile. For patches in this "scripts" branch and if it is easier for you, you can also propose a PR on GitHub. If you prefer continuing sending patches by email, please use 'mptcp-scripts' instead of 'mptcp-next' to avoid confusions ;-) Cheers, Matt -- Tessares | Belgium | Hybrid Access Solutions www.tessares.net ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-03-01 10:06 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2022-02-28 14:32 [PATCH mptcp-next v2 0/2] fix libbpf 0.7 deprecated warnings Geliang Tang 2022-02-28 14:32 ` [PATCH mptcp-next v2 1/2] bpf: examples: static library link to libbpf Geliang Tang 2022-02-28 14:32 ` [PATCH mptcp-next v2 2/2] bpf: examples: fix libbpf 0.7 deprecated warnings Geliang Tang 2022-03-01 10:06 ` [PATCH mptcp-next v2 0/2] " Matthieu Baerts
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.