From: John Fastabend <john.fastabend@gmail.com>
To: Di Zhu <zhudi2@huawei.com>,
davem@davemloft.net, ast@kernel.org, daniel@iogearbox.net,
andrii@kernel.org, kafai@fb.com, songliubraving@fb.com,
yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org,
jakub@cloudflare.com
Cc: bpf@vger.kernel.org, linux-kernel@vger.kernel.org, zhudi2@huawei.com
Subject: RE: [PATCH] bpf: support BPF_PROG_QUERY for progs attached to sockmap
Date: Fri, 22 Oct 2021 08:46:47 -0700 [thread overview]
Message-ID: <6172dce78e957_82a7f2082@john-XPS-13-9370.notmuch> (raw)
In-Reply-To: <20211022103348.284562-1-zhudi2@huawei.com>
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@huawei.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
next prev parent reply other threads:[~2021-10-22 15:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-22 10:33 Di Zhu
2021-10-22 15:25 ` Alexei Starovoitov
2021-10-22 15:46 ` John Fastabend [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-10-23 6:05 zhudi (E)
2021-10-23 6:01 zhudi (E)
2021-10-19 12:58 Di Zhu
2021-10-22 0:36 ` Alexei Starovoitov
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=6172dce78e957_82a7f2082@john-XPS-13-9370.notmuch \
--to=john.fastabend@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=jakub@cloudflare.com \
--cc=kafai@fb.com \
--cc=kpsingh@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=songliubraving@fb.com \
--cc=yhs@fb.com \
--cc=zhudi2@huawei.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
all inboxes | Powered by JetHome®