[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5a7efbd1-f05b-4b49-d9a8-ef5c4c6b8ee0@kernel.org>
Date: Wed, 18 Oct 2023 08:35:30 -0600
From: David Ahern <dsahern@...nel.org>
To: Shung-Hsi Yu <shung-hsi.yu@...e.com>, netdev@...r.kernel.org
Cc: Stephen Hemminger <stephen@...workplumber.org>,
Toke Høiland-Jørgensen <toke@...hat.com>
Subject: Re: [PATCH iproute2-next 2/2] bpf: increase verifier verbosity when
in verbose mode
On 10/18/23 12:22 AM, Shung-Hsi Yu wrote:
> diff --git a/lib/bpf_libbpf.c b/lib/bpf_libbpf.c
> index f678a710..08692d30 100644
> --- a/lib/bpf_libbpf.c
> +++ b/lib/bpf_libbpf.c
> @@ -285,11 +285,14 @@ 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
> );
>
> +#if (LIBBPF_MAJOR_VERSION > 0) || (LIBBPF_MINOR_VERSION >= 7)
> + open_opts.kernel_log_level = 1;
> + if (cfg->verbose)
> + open_opts.kernel_log_level |= 2;
> +#endif
> +
> obj = bpf_object__open_file(cfg->object, &open_opts);
> if (libbpf_get_error(obj)) {
> fprintf(stderr, "ERROR: opening BPF object file failed\n");
Why have the first patch if you redo the code here?
Powered by blists - more mailing lists