public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
From: Ihor Solodrai <ihor.solodrai@linux.dev>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Eduard Zingerman <eddyz87@gmail.com>, bpf <bpf@vger.kernel.org>,
	Kernel Team <kernel-team@meta.com>
Subject: Re: [PATCH bpf-next v3 1/2] bpf: Support struct btf_struct_meta via KF_IMPLICIT_ARGS
Date: Fri, 27 Mar 2026 15:06:25 -0700	[thread overview]
Message-ID: <fd982667-1fce-4472-a13b-ade388b01b88@linux.dev> (raw)
In-Reply-To: <CAADnVQKRDHu=kn1U98jnY1XVk__ZGC1iyRQZdPH1g1=wgA1pWQ@mail.gmail.com>

On 3/27/26 2:47 PM, Alexei Starovoitov wrote:
> On Fri, Mar 27, 2026 at 2:08 PM Ihor Solodrai <ihor.solodrai@linux.dev> wrote:
>>
>> On 3/27/26 2:00 PM, Alexei Starovoitov wrote:
>>> On Fri, Mar 27, 2026 at 1:55 PM Ihor Solodrai <ihor.solodrai@linux.dev> wrote:
>>>>
>>>> On 3/27/26 1:48 PM, Alexei Starovoitov wrote:
>>>>> On Thu, Mar 26, 2026 at 12:13 PM Ihor Solodrai <ihor.solodrai@linux.dev> wrote:
>>>>>>
>>>>>> [...]
>>>>>>
>>>>>> The above works, and the question now is if we like this mechanism
>>>>>> more than current setup with explicit enums.
>>>>>
>>>>> Got it. Thanks for the explanation.
>>>>> Your approach does sound a lot better than explicit enums.
>>>>> Make a proper patch out of it.
>>>>>
>>>>> If we do this can we remove <counter><line> approach everywhere
>>>>> while at it and only use named ?
>>>>
>>>> This crossed my mind too. I'll try to *replace* the suffixes and if
>>>> it works fine submit that.
>>>>
>>>> One inconvenience is that with named suffixes BTF_ID() macro will
>>>> have to accept an additional arg (the list name), but I think
>>>> that's ok. We already have to pass struct/func everywhere too.
>>>
>>> and that name has to be unique.. I think it's fine.
>>> I'd do such change, and reuse all of BTF_ID macros.
>>> So that only BTF_SET_START line will differ.
>>>
>>> The overall diff stat shouldn't be big ?
>>
>> Depends on whether we are refactoring BTF_ID, or just adding new
>> BTF_ID_NAMED set of macros.
> 
> I meant that BTF_ID_NAMED(special_kfunc_list
> would somehow remember that it belongs to BTF_ID_LIST_NAMED
> that started this "scrope" few lines above an actual BTF_ID(..)
> ?
> 
> or for BTF_ID(func, bpf_lsm_bpf_prog_free)
> we consider 'func' to be that 'scope' ?
> 
> we don't have uniqueness across files:
> BTF_SET_START(untrusted_lsm_hooks)
> BTF_ID(func, bpf_lsm_bpf_map_free)
> BTF_ID(func, bpf_lsm_bpf_prog_free)
> ..
> 
> BTF_SET_START(sleepable_lsm_hooks)
> ...
> BTF_ID(func, bpf_lsm_bpf_map_free)
> ...
> BTF_ID(func, bpf_lsm_bpf_prog_free)
> 
> but does it matter?
> This new BTF_ID() will define multiple extern u32 with the same name.
> Make them weak since they point to the same id ?

Let me play with this, maybe I (or AI) can come up with something
like you're describing.

I'll aim to submit a patch next week.


      reply	other threads:[~2026-03-27 22:06 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-18 23:42 [PATCH bpf-next v3 1/2] bpf: Support struct btf_struct_meta via KF_IMPLICIT_ARGS Ihor Solodrai
2026-03-18 23:42 ` [PATCH bpf-next v3 2/2] selftests/bpf: Update kfuncs using btf_struct_meta to new variants Ihor Solodrai
2026-03-19 12:30   ` Jiri Olsa
2026-03-19 20:43     ` Ihor Solodrai
2026-03-20 11:06       ` Jiri Olsa
2026-03-20 14:50   ` Mykyta Yatsenko
2026-03-19 12:25 ` [PATCH bpf-next v3 1/2] bpf: Support struct btf_struct_meta via KF_IMPLICIT_ARGS Jiri Olsa
2026-03-19 20:37   ` Ihor Solodrai
2026-03-20 15:49 ` Mykyta Yatsenko
2026-03-27  0:16   ` Ihor Solodrai
2026-03-27 19:19     ` Mykyta Yatsenko
2026-03-21 20:27 ` Alexei Starovoitov
2026-03-23 19:58   ` Ihor Solodrai
2026-03-24 17:22     ` Alexei Starovoitov
2026-03-26 19:13       ` Ihor Solodrai
2026-03-27 20:48         ` Alexei Starovoitov
2026-03-27 20:55           ` Ihor Solodrai
2026-03-27 21:00             ` Alexei Starovoitov
2026-03-27 21:08               ` Ihor Solodrai
2026-03-27 21:47                 ` Alexei Starovoitov
2026-03-27 22:06                   ` Ihor Solodrai [this message]

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=fd982667-1fce-4472-a13b-ade388b01b88@linux.dev \
    --to=ihor.solodrai@linux.dev \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=kernel-team@meta.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