[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6172dce78e957_82a7f2082@john-XPS-13-9370.notmuch>
Date: Fri, 22 Oct 2021 08:46:47 -0700
From: John Fastabend <john.fastabend@...il.com>
To: Di Zhu <zhudi2@...wei.com>, davem@...emloft.net, ast@...nel.org,
daniel@...earbox.net, andrii@...nel.org, kafai@...com,
songliubraving@...com, yhs@...com, john.fastabend@...il.com,
kpsingh@...nel.org, jakub@...udflare.com
Cc: bpf@...r.kernel.org, linux-kernel@...r.kernel.org,
zhudi2@...wei.com
Subject: RE: [PATCH] bpf: support BPF_PROG_QUERY for progs attached to sockmap
Di Zhu wrote:
> Right now there is no way to query whether BPF programs are
> attached to a sockmap or not.
>
> we can use the standard interface in libbpf to query, such as:
> bpf_prog_query(mapFd, BPF_SK_SKB_STREAM_PARSER, 0, NULL, ...);
> the mapFd is the fd of sockmap.
>
> Signed-off-by: Di Zhu <zhudi2@...wei.com>
> ---
LGTM, lets add a small test here as well
./tools/testing/selftests/bpf/prog_tests/sockmap_basic.c
Looks like we can just copy the sk_lookup.c test case which does
the query tests for BPF_SK_LOOKUP.
Also I don't think its required for this series, but a bpftool
patch to query it would be useful as well if its doesn't just
work with above.
Thanks!
John
Powered by blists - more mailing lists