All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hangbin Liu <haliu@redhat.com>
To: David Ahern <dsahern@kernel.org>
Cc: netdev@vger.kernel.org, stephen@networkplumber.org,
	toke@redhat.com, Paul Chaignon <paul@isovalent.com>
Subject: Re: [PATCH iproute2-next 1/3] libbpf: Use bpf_object__load instead of bpf_object__load_xattr
Date: Sun, 24 Apr 2022 09:56:57 +0800	[thread overview]
Message-ID: <YmSuaX7MUIqoNbC3@Laptop-X1> (raw)
In-Reply-To: <20220423152300.16201-2-dsahern@kernel.org>

Hi David,

This patch revert c04e45d0 lib/bpf: fix verbose flag when using libbpf,
Should we set prog->log_level directly before it loaded, like
bpf_program__set_log_level() does?

Thanks
Hangbin
On Sat, Apr 23, 2022 at 09:22:58AM -0600, David Ahern wrote:
> bpf_object__load_xattr is deprecated as of v0.8+; remove it
> in favor of bpf_object__load.
> 
> Signed-off-by: David Ahern <dsahern@kernel.org>
> ---
>  lib/bpf_libbpf.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/lib/bpf_libbpf.c b/lib/bpf_libbpf.c
> index f4f98caa1e58..f723f6310c28 100644
> --- a/lib/bpf_libbpf.c
> +++ b/lib/bpf_libbpf.c
> @@ -248,7 +248,6 @@ static int handle_legacy_maps(struct bpf_object *obj)
>  
>  static int load_bpf_object(struct bpf_cfg_in *cfg)
>  {
> -	struct bpf_object_load_attr attr = {};
>  	struct bpf_program *p, *prog = NULL;
>  	struct bpf_object *obj;
>  	char root_path[PATH_MAX];
> @@ -305,11 +304,7 @@ static int load_bpf_object(struct bpf_cfg_in *cfg)
>  	if (ret)
>  		goto unload_obj;
>  
> -	attr.obj = obj;
> -	if (cfg->verbose)
> -		attr.log_level = 2;
> -
> -	ret = bpf_object__load_xattr(&attr);
> +	ret = bpf_object__load(obj);
>  	if (ret)
>  		goto unload_obj;
>  
> -- 
> 2.24.3 (Apple Git-128)
> 


  reply	other threads:[~2022-04-24  1:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-23 15:22 [PATCH iproute2-next 0/3] Address more libbpf deprecations David Ahern
2022-04-23 15:22 ` [PATCH iproute2-next 1/3] libbpf: Use bpf_object__load instead of bpf_object__load_xattr David Ahern
2022-04-24  1:56   ` Hangbin Liu [this message]
2022-04-24 16:10     ` David Ahern
2022-04-26  2:29       ` Hangbin Liu
2022-04-23 15:22 ` [PATCH iproute2-next 2/3] libbpf: Remove use of bpf_program__set_priv and bpf_program__priv David Ahern
2022-04-23 15:23 ` [PATCH iproute2-next 3/3] libbpf: Remove use of bpf_map_is_offload_neutral David Ahern
2022-04-23 21:35 ` [PATCH iproute2-next 0/3] Address more libbpf deprecations Toke Høiland-Jørgensen
2022-05-02 21:50 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YmSuaX7MUIqoNbC3@Laptop-X1 \
    --to=haliu@redhat.com \
    --cc=dsahern@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=paul@isovalent.com \
    --cc=stephen@networkplumber.org \
    --cc=toke@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.