From: Martin KaFai Lau <kafai@fb.com>
To: Stanislav Fomichev <sdf@google.com>
Cc: netdev@vger.kernel.org, bpf@vger.kernel.org, ast@kernel.org,
daniel@iogearbox.net, andrii@kernel.org
Subject: Re: [PATCH bpf-next v10 09/11] libbpf: implement bpf_prog_query_opts
Date: Thu, 23 Jun 2022 15:58:13 -0700 [thread overview]
Message-ID: <20220623225813.4vu3hgar7d3jgbja@kafai-mbp> (raw)
In-Reply-To: <20220622160346.967594-10-sdf@google.com>
On Wed, Jun 22, 2022 at 09:03:44AM -0700, Stanislav Fomichev wrote:
> Implement bpf_prog_query_opts as a more expendable version of
> bpf_prog_query. Expose new prog_attach_flags and attach_btf_func_id as
> well:
>
> * prog_attach_flags is a per-program attach_type; relevant only for
> lsm cgroup program which might have different attach_flags
> per attach_btf_id
> * attach_btf_func_id is a new field expose for prog_query which
> specifies real btf function id for lsm cgroup attachments
>
> Acked-by: Andrii Nakryiko <andrii@kernel.org>
> Signed-off-by: Stanislav Fomichev <sdf@google.com>
> ---
> tools/include/uapi/linux/bpf.h | 3 +++
> tools/lib/bpf/bpf.c | 38 +++++++++++++++++++++++++++-------
> tools/lib/bpf/bpf.h | 15 ++++++++++++++
> tools/lib/bpf/libbpf.map | 1 +
> 4 files changed, 50 insertions(+), 7 deletions(-)
>
> diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
> index b7479898c879..ad9e7311c4cf 100644
> --- a/tools/include/uapi/linux/bpf.h
> +++ b/tools/include/uapi/linux/bpf.h
> @@ -1432,6 +1432,7 @@ union bpf_attr {
> __u32 attach_flags;
> __aligned_u64 prog_ids;
> __u32 prog_cnt;
> + __aligned_u64 prog_attach_flags; /* output: per-program attach_flags */
> } query;
>
> struct { /* anonymous struct used by BPF_RAW_TRACEPOINT_OPEN command */
> @@ -6076,6 +6077,8 @@ struct bpf_prog_info {
> __u64 run_cnt;
> __u64 recursion_misses;
> __u32 verified_insns;
> + __u32 attach_btf_obj_id;
> + __u32 attach_btf_id;
> } __attribute__((aligned(8)));
nit. This could be done together in patch 5.
Acked-by: Martin KaFai Lau <kafai@fb.com>
next prev parent reply other threads:[~2022-06-23 22:58 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-22 16:03 [PATCH bpf-next v10 00/11] bpf: cgroup_sock lsm flavor Stanislav Fomichev
2022-06-22 16:03 ` [PATCH bpf-next v10 01/11] bpf: add bpf_func_t and trampoline helpers Stanislav Fomichev
2022-06-22 16:03 ` [PATCH bpf-next v10 02/11] bpf: convert cgroup_bpf.progs to hlist Stanislav Fomichev
2022-06-22 16:03 ` [PATCH bpf-next v10 03/11] bpf: per-cgroup lsm flavor Stanislav Fomichev
2022-06-23 22:40 ` Martin KaFai Lau
2022-06-22 16:03 ` [PATCH bpf-next v10 04/11] bpf: minimize number of allocated lsm slots per program Stanislav Fomichev
2022-06-23 22:41 ` Martin KaFai Lau
2022-06-22 16:03 ` [PATCH bpf-next v10 05/11] bpf: implement BPF_PROG_QUERY for BPF_LSM_CGROUP Stanislav Fomichev
2022-06-22 16:03 ` [PATCH bpf-next v10 06/11] bpf: expose bpf_{g,s}etsockopt to lsm cgroup Stanislav Fomichev
2022-06-23 22:43 ` Martin KaFai Lau
2022-06-22 16:03 ` [PATCH bpf-next v10 07/11] tools/bpf: Sync btf_ids.h to tools Stanislav Fomichev
2022-06-23 22:54 ` Martin KaFai Lau
2022-06-22 16:03 ` [PATCH bpf-next v10 08/11] libbpf: add lsm_cgoup_sock type Stanislav Fomichev
2022-06-23 22:54 ` Martin KaFai Lau
2022-06-22 16:03 ` [PATCH bpf-next v10 09/11] libbpf: implement bpf_prog_query_opts Stanislav Fomichev
2022-06-23 22:58 ` Martin KaFai Lau [this message]
2022-06-22 16:03 ` [PATCH bpf-next v10 10/11] bpftool: implement cgroup tree for BPF_LSM_CGROUP Stanislav Fomichev
2022-06-23 22:58 ` Martin KaFai Lau
2022-06-22 16:03 ` [PATCH bpf-next v10 11/11] selftests/bpf: lsm_cgroup functional test Stanislav Fomichev
2022-06-23 22:36 ` Martin KaFai Lau
2022-06-23 23:48 ` Stanislav Fomichev
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=20220623225813.4vu3hgar7d3jgbja@kafai-mbp \
--to=kafai@fb.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=netdev@vger.kernel.org \
--cc=sdf@google.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