From: Yonghong Song <yonghong.song@linux.dev>
To: Ming Lei <ming.lei@redhat.com>
Cc: Kui-Feng Lee <sinquersw@gmail.com>,
bpf@vger.kernel.org, ast@kernel.org, martin.lau@linux.dev,
song@kernel.org, andrii@kernel.org, drosen@google.com,
kuifeng@meta.com, thinker.li@gmail.com,
Benjamin Tissoires <bentiss@kernel.org>,
Jiri Kosina <jikos@kernel.org>
Subject: Re: [PATCH] bpf: export btf_find_by_name_kind and bpf_base_func_proto
Date: Thu, 25 Jul 2024 22:39:51 -0700 [thread overview]
Message-ID: <a529d615-1cb5-4d5a-a78e-06e71676fc5f@linux.dev> (raw)
In-Reply-To: <CAFj5m9KMvObO1KP+TdxBdE5psnDKv4RaAUOCjOAXJ0gSpB22Hg@mail.gmail.com>
On 7/25/24 8:45 PM, Ming Lei wrote:
> On Fri, Jul 26, 2024 at 11:21 AM Yonghong Song <yonghong.song@linux.dev> wrote:
>>
>> On 7/24/24 2:13 AM, Ming Lei wrote:
>>> On Tue, Jul 23, 2024 at 09:43:12PM -0700, Kui-Feng Lee wrote:
>>>> On 7/23/24 20:19, Ming Lei wrote:
>>>>> Export btf_find_by_name_kind and bpf_base_func_proto, so that kernel
>>>>> module can use them.
>>>>>
>>>>> Almost all existed struct_ops users(hid, sched_ext, ...) need the two APIs.
>>>>>
>>>>> Without this change, hid-bpf can't be built as module.
>>>> Could you give me more context?
>>>> Give me a link of an example code or something?
>>>> Or explain the use case?
>>> The merged patchset "Registrating struct_ops types from modules" is
>>> trying to allow module to register struct_ops, which often needs
>>> bpf_base_func_proto()(for allowing generic helpers available in
>>> prog) and btf_find_by_name_kind() (for implementing .btf_struct_access).
>>>
>>> One example is hid-bpf, which is a driver and supposed to build as module,
>>> but it can't be done because the two APIs aren't exported.
>> Could you give more specific examples about where these two APIs are
>> used in hid-bpf?
> Sure, hid-bpf struct_ops has been merged to linus tree already.
>
> However, it can't be built as module because the two APIs aren't exported:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/hid/bpf/hid_bpf_struct_ops.c
Okay, From the above hid_bpf_struct_ops.c, I do see bpf_base_func_proto() and
btf_find_by_name_kind() are used.
Your change looks good to me. Please add more details in the commit message and resubmit.
Your subject
[PATCH] bpf: export btf_find_by_name_kind and bpf_base_func_proto
please change to
[PATCH bpf-next] bpf: export btf_find_by_name_kind and bpf_base_func_proto
The above 'bpf-next' ensures CI to test your patch.
>
> Thanks,
> Ming
>
next prev parent reply other threads:[~2024-07-26 5:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-24 3:19 [PATCH] bpf: export btf_find_by_name_kind and bpf_base_func_proto Ming Lei
2024-07-24 4:43 ` Kui-Feng Lee
2024-07-24 9:13 ` Ming Lei
2024-07-26 3:20 ` Yonghong Song
2024-07-26 3:45 ` Ming Lei
2024-07-26 5:39 ` Yonghong Song [this message]
2024-07-26 11:52 ` Ming Lei
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=a529d615-1cb5-4d5a-a78e-06e71676fc5f@linux.dev \
--to=yonghong.song@linux.dev \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bentiss@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=drosen@google.com \
--cc=jikos@kernel.org \
--cc=kuifeng@meta.com \
--cc=martin.lau@linux.dev \
--cc=ming.lei@redhat.com \
--cc=sinquersw@gmail.com \
--cc=song@kernel.org \
--cc=thinker.li@gmail.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 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.