From: Martin KaFai Lau <martin.lau@linux.dev>
To: Amery Hung <ameryhung@gmail.com>
Cc: bpf@vger.kernel.org, daniel@iogearbox.net, andrii@kernel.org,
alexei.starovoitov@gmail.com, martin.lau@kernel.org,
eddyz87@gmail.com, kernel-team@meta.com
Subject: Re: [PATCH bpf-next v1 2/5] bpf: Support getting referenced kptr from struct_ops argument
Date: Fri, 14 Feb 2025 16:49:44 -0800 [thread overview]
Message-ID: <4661b71e-4932-4c80-ad6d-073fc4e8ae90@linux.dev> (raw)
In-Reply-To: <20250214164520.1001211-3-ameryhung@gmail.com>
On 2/14/25 8:45 AM, Amery Hung wrote:
> diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
> index 9de6acddd479..fd3470fbd144 100644
> --- a/kernel/bpf/btf.c
> +++ b/kernel/bpf/btf.c
> @@ -6677,6 +6677,7 @@ bool btf_ctx_access(int off, int size, enum bpf_access_type type,
> info->reg_type = ctx_arg_info->reg_type;
> info->btf = ctx_arg_info->btf ? : btf_vmlinux;
> info->btf_id = ctx_arg_info->btf_id;
> + info->ref_obj_id = ctx_arg_info->refcounted ? ctx_arg_info->ref_obj_id : 0;
A small nit. No need to check ctx_arg_info->refcounted. If refcounted is false,
ref_obj_id should have been 0.
info->ref_obj_id = ctx_arg_info->ref_obj_id;
Acked-by: Martin KaFai Lau <martin.lau@kernel.org>
next prev parent reply other threads:[~2025-02-15 0:49 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-14 16:45 [PATCH bpf-next v1 0/5] Extend struct_ops support for operators Amery Hung
2025-02-14 16:45 ` [PATCH bpf-next v1 1/5] bpf: Make every prog keep a copy of ctx_arg_info Amery Hung
2025-02-15 0:20 ` Martin KaFai Lau
2025-02-15 2:41 ` Alexei Starovoitov
2025-02-15 4:39 ` Amery Hung
2025-02-14 16:45 ` [PATCH bpf-next v1 2/5] bpf: Support getting referenced kptr from struct_ops argument Amery Hung
2025-02-15 0:49 ` Martin KaFai Lau [this message]
2025-02-15 2:48 ` Alexei Starovoitov
2025-02-15 4:58 ` Amery Hung
2025-02-14 16:45 ` [PATCH bpf-next v1 3/5] selftests/bpf: Test referenced kptr arguments of struct_ops programs Amery Hung
2025-02-15 1:14 ` Martin KaFai Lau
2025-02-15 4:30 ` Amery Hung
2025-02-14 16:45 ` [PATCH bpf-next v1 4/5] bpf: Allow struct_ops prog to return referenced kptr Amery Hung
2025-02-15 1:42 ` Martin KaFai Lau
2025-02-14 16:45 ` [PATCH bpf-next v1 5/5] selftests/bpf: Test returning referenced kptr from struct_ops programs Amery Hung
2025-02-15 1:52 ` Martin KaFai Lau
2025-02-15 2:09 ` [PATCH bpf-next v1 0/5] Extend struct_ops support for operators Martin KaFai Lau
2025-02-18 22:20 ` Amery Hung
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=4661b71e-4932-4c80-ad6d-073fc4e8ae90@linux.dev \
--to=martin.lau@linux.dev \
--cc=alexei.starovoitov@gmail.com \
--cc=ameryhung@gmail.com \
--cc=andrii@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=kernel-team@meta.com \
--cc=martin.lau@kernel.org \
/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