Re: [PATCH bpf-next v2 1/2] bpftool: mark orphaned programs during prog show

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2023-11-22 22:23 UTC+0000 ~ Stanislav Fomichev <sdf@xxxxxxxxxx>
> 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@xxxxxxxxxxxxxx/
> 
> Fixes: ef01f4e25c17 ("bpf: restore the ebpf program ID for BPF_AUDIT_UNLOAD and PERF_BPF_EVENT_PROG_UNLOAD")
> Signed-off-by: Stanislav Fomichev <sdf@xxxxxxxxxx>
> ---
>  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!




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux