From: Martin KaFai Lau <martin.lau@linux.dev>
To: Amery Hung <ameryhung@gmail.com>
Cc: daniel@iogearbox.net, andrii@kernel.org,
alexei.starovoitov@gmail.com, martin.lau@kernel.org,
eddyz87@gmail.com, kernel-team@meta.com, bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next v4 2/2] selftests/bpf: Test gen_pro/epilogue that generate kfuncs
Date: Tue, 25 Feb 2025 13:58:15 -0800 [thread overview]
Message-ID: <313aff82-75c0-4575-ab3d-9a4037f47307@linux.dev> (raw)
In-Reply-To: <20250225212915.145949-2-ameryhung@gmail.com>
On 2/25/25 1:29 PM, Amery Hung wrote:
> @@ -1411,6 +1496,13 @@ static void st_ops_unreg(void *kdata, struct bpf_link *link)
>
> static int st_ops_init(struct btf *btf)
> {
> + struct btf *kfunc_btf;
> +
> + bpf_cgroup_from_id_id = bpf_find_btf_id("bpf_cgroup_from_id", BTF_KIND_FUNC, &kfunc_btf);
> + bpf_cgroup_release_id = bpf_find_btf_id("bpf_cgroup_release", BTF_KIND_FUNC, &kfunc_btf);
> + if (!bpf_cgroup_from_id_id || !bpf_cgroup_release_id)
Just noticed this. This should be "< 0" check. No need for "== 0" check because
"id == 0" is reserved for "void" which is not BTF_KIND_FUNC.
With that,
Acked-by: Martin KaFai Lau <martin.lau@kernel.org>
next prev parent reply other threads:[~2025-02-25 21:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-25 21:29 [PATCH bpf-next v4 1/2] bpf: Search and add kfuncs in struct_ops prologue and epilogue Amery Hung
2025-02-25 21:29 ` [PATCH bpf-next v4 2/2] selftests/bpf: Test gen_pro/epilogue that generate kfuncs Amery Hung
2025-02-25 21:58 ` Martin KaFai Lau [this message]
2025-02-25 22:02 ` Amery Hung
2025-02-25 21:54 ` [PATCH bpf-next v4 1/2] bpf: Search and add kfuncs in struct_ops prologue and epilogue Martin KaFai Lau
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=313aff82-75c0-4575-ab3d-9a4037f47307@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.