BPF List
 help / color / mirror / Atom feed
From: Stanislav Fomichev <sdf@google.com>
To: Quentin Monnet <quentin@isovalent.com>
Cc: bpf@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net,
	 andrii@kernel.org, martin.lau@linux.dev, song@kernel.org,
	yhs@fb.com,  john.fastabend@gmail.com, kpsingh@kernel.org,
	haoluo@google.com,  jolsa@kernel.org
Subject: Re: [PATCH bpf-next v2 1/2] bpftool: mark orphaned programs during prog show
Date: Mon, 27 Nov 2023 10:02:33 -0800	[thread overview]
Message-ID: <ZWTZucxHSw6wovwi@google.com> (raw)
In-Reply-To: <402e2e7a-c01c-4aad-8ca2-0dd40282820e@isovalent.com>

On 11/23, Quentin Monnet wrote:
> 2023-11-22 22:23 UTC+0000 ~ Stanislav Fomichev <sdf@google.com>
> > Commit ef01f4e25c17 ("bpf: restore the ebpf program ID for BPF_AUDIT_UNLOAD
> > and PERF_BPF_EVENT_PROG_UNLOAD") stopped removing program's id from
> > idr when the offloaded/bound netdev goes away. I was supposed to
> > take a look and check in [0], but apparently I did not.
> > 
> > Martin points out it might be useful to keep it that way for
> > observability sake, but we at least need to mark those programs as
> > unusable.
> > 
> > Mark those programs as 'orphaned' and keep printing the list when
> > we encounter ENODEV.
> > 
> > 0: unspec  tag 0000000000000000
> >         xlated 0B  not jited  memlock 4096B orphaned
> > 
> > [0]: https://lore.kernel.org/all/CAKH8qBtyR20ZWAc11z1-6pGb3Hd47AQUTbE_cfoktG59TqaJ7Q@mail.gmail.com/
> > 
> > Fixes: ef01f4e25c17 ("bpf: restore the ebpf program ID for BPF_AUDIT_UNLOAD and PERF_BPF_EVENT_PROG_UNLOAD")
> > Signed-off-by: Stanislav Fomichev <sdf@google.com>
> > ---
> >  tools/bpf/bpftool/prog.c | 14 +++++++++-----
> >  1 file changed, 9 insertions(+), 5 deletions(-)
> > 
> > diff --git a/tools/bpf/bpftool/prog.c b/tools/bpf/bpftool/prog.c
> > index 7ec4f5671e7a..a4f23692c187 100644
> > --- a/tools/bpf/bpftool/prog.c
> > +++ b/tools/bpf/bpftool/prog.c
> 
> > @@ -554,6 +555,9 @@ static void print_prog_plain(struct bpf_prog_info *info, int fd)
> >  		printf("  memlock %sB", memlock);
> >  	free(memlock);
> >  
> > +	if (orphaned)
> > +		printf(" orphaned");
> 
> Please use a double space at the beginning of "  orphaned" here, this is
> what we do elsewhere in bpftool to make the different fields easier to
> dissociate visually (given that some contain multiple words).
> 
> Looks good otherwise. Thanks!

Sure, will do, thanks!

      reply	other threads:[~2023-11-27 18:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-22 22:23 [PATCH bpf-next v2 1/2] bpftool: mark orphaned programs during prog show Stanislav Fomichev
2023-11-22 22:23 ` [PATCH bpf-next v2 2/2] selftests/bpf: update test_offload to use new orphaned property Stanislav Fomichev
2023-11-23 13:36 ` [PATCH bpf-next v2 1/2] bpftool: mark orphaned programs during prog show Quentin Monnet
2023-11-27 18:02   ` Stanislav Fomichev [this message]

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=ZWTZucxHSw6wovwi@google.com \
    --to=sdf@google.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=haoluo@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=quentin@isovalent.com \
    --cc=song@kernel.org \
    --cc=yhs@fb.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox