[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231018062234.20492-2-shung-hsi.yu@suse.com>
Date: Wed, 18 Oct 2023 14:22:33 +0800
From: Shung-Hsi Yu <shung-hsi.yu@...e.com>
To: netdev@...r.kernel.org
Cc: Shung-Hsi Yu <shung-hsi.yu@...e.com>,
Stephen Hemminger <stephen@...workplumber.org>,
David Ahern <dsahern@...nel.org>,
Toke Høiland-Jørgensen <toke@...hat.com>
Subject: [PATCH iproute2-next 1/2] libbpf: set kernel_log_level when available
libbpf allows setting the log_level in struct bpf_open_opts through the
kernel_log_level field since v0.7, use it to set log level to align with
bpf_prog_load_dev() and bpf_btf_load().
Signed-off-by: Shung-Hsi Yu <shung-hsi.yu@...e.com>
---
lib/bpf_libbpf.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/bpf_libbpf.c b/lib/bpf_libbpf.c
index e1c211a1..f678a710 100644
--- a/lib/bpf_libbpf.c
+++ b/lib/bpf_libbpf.c
@@ -285,6 +285,9 @@ static int load_bpf_object(struct bpf_cfg_in *cfg)
DECLARE_LIBBPF_OPTS(bpf_object_open_opts, open_opts,
.relaxed_maps = true,
.pin_root_path = root_path,
+#ifdef (LIBBPF_MAJOR_VERSION > 0) || (LIBBPF_MINOR_VERSION >= 7)
+ .kernel_log_level = 1,
+#endif
);
obj = bpf_object__open_file(cfg->object, &open_opts);
--
2.42.0
Powered by blists - more mailing lists