mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: bot+bpf-ci@kernel.org
To: wanjay@amazon.com,bpf@vger.kernel.org,ast@kernel.org,daniel@iogearbox.net,andrii@kernel.org,eddyz87@gmail.com,memxor@gmail.com
Cc: alan.maguire@oracle.com,martin.lau@linux.dev,yonghong.song@linux.dev,nathan@kernel.org,nsc@kernel.org,linux-kbuild@vger.kernel.org,mcgrof@kernel.org,petr.pavlu@suse.com,linux-modules@vger.kernel.org,arnd@arndb.de,linux-kernel@vger.kernel.org,abuehaze@amazon.com,doebel@amazon.de,jay.wang.upstream@gmail.com,ast@kernel.org,andrii@kernel.org,daniel@iogearbox.net,martin.lau@kernel.org,eddyz87@gmail.com,yonghong.song@linux.dev,mason@kernel.org,ihor.solodrai@linux.dev
Subject: Re: [PATCH bpf-next 2/6] bpf: split the kfunc, dtor kfunc and struct_ops registration bodies
Date: Wed, 23 Sep 2026 06:16:21 +0000 (UTC)	[thread overview]
Message-ID: <9ae62cc7c8da94b68778bfd040a658730a7b098ddc64f6d23d9a4a895f71b994@mail.kernel.org> (raw)
In-Reply-To: <20260923053948.30617-3-wanjay@amazon.com>

[-- Attachment #1: Type: text/plain, Size: 1793 bytes --]

> diff --git a/kernel/bpf/bpf_struct_ops.c b/kernel/bpf/bpf_struct_ops.c
> index 1178acd72296..bf3004908d15 100644
> --- a/kernel/bpf/bpf_struct_ops.c
> +++ b/kernel/bpf/bpf_struct_ops.c

[ ... ]

> diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
> index a6634237dc89..c3c1421208b4 100644
> --- a/kernel/bpf/btf.c
> +++ b/kernel/bpf/btf.c

[ ... ]

> @@ -10135,32 +10150,36 @@ bpf_struct_ops_find(struct btf *btf, u32 type_id)
>  	return NULL;
>  }
>
> -int __register_bpf_struct_ops(struct bpf_struct_ops *st_ops)
> +static int btf_struct_ops_add(struct btf *btf, struct bpf_struct_ops *st_ops)
>  {
>  	struct bpf_verifier_log *log;
> -	struct btf *btf;
> -	int err = 0;
> -
> -	btf = btf_get_module_btf(st_ops->owner);
> -	if (!btf)
> -		return check_btf_kconfigs(st_ops->owner, "struct_ops");
> -	if (IS_ERR(btf))
> -		return PTR_ERR(btf);
> +	int err;
>
>  	log = kzalloc_obj(*log, GFP_KERNEL | __GFP_NOWARN);
> -	if (!log) {
> -		err = -ENOMEM;
> -		goto errout;
> -	}
> +	if (!log)
> +		return -ENOMEM;
>
>  	log->level = BPF_LOG_KERNEL;
>
>  	err = btf_add_struct_ops(btf, st_ops, log);

This isn't a bug, but btf_struct_ops_add() sits next to the existing
btf_add_struct_ops() that it calls - would a name that does not mirror
the callee, for example btf_register_struct_ops() or
btf_struct_ops_add_locked(), read more clearly here?

The two names differ only in word order, and a reader scanning the file
or grepping has to check which of the two is the wrapper.

>
> -errout:
>  	kfree(log);
> -	btf_put(btf);
> +	return err;
> +}

[ ... ]


---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md

CI run summary: https://github.com/kernel-patches/bpf/actions/runs/35824427607

  reply	other threads:[~2026-09-23  6:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-23  5:39 [PATCH bpf-next 0/6] bpf: make the vmlinux BTF an on-demand loadable module (CONFIG_DEBUG_INFO_BTF=m) to save ~5.4 MB memory Jay Wang
2026-09-23  5:39 ` [PATCH bpf-next 1/6] bpf: pass the vmlinux BTF to btf_parse_module() and let it adopt the data Jay Wang
2026-09-23  5:39 ` [PATCH bpf-next 2/6] bpf: split the kfunc, dtor kfunc and struct_ops registration bodies Jay Wang
2026-09-23  6:16   ` bot+bpf-ci [this message]
2026-09-25 23:02     ` Jay Wang
2026-09-23  5:39 ` [PATCH bpf-next 3/6] bpf: fetch the vmlinux BTF where kernel types enter a program Jay Wang
2026-09-23  6:28   ` bot+bpf-ci
2026-09-24 11:26     ` Jiri Olsa
2026-09-25 23:02       ` Jay Wang
2026-09-25 23:02     ` Jay Wang
2026-09-23  5:39 ` [PATCH bpf-next 4/6] bpf: take the vmlinux BTF from the btf_vmlinux module Jay Wang
2026-09-23  5:39 ` [PATCH bpf-next 5/6] bpf: defer registrations until the vmlinux BTF is available Jay Wang
2026-09-23  6:41   ` bot+bpf-ci
2026-09-25 23:02     ` Jay Wang
2026-09-23  5:39 ` [PATCH bpf-next 6/6] kbuild, bpf: allow building the vmlinux BTF as a module Jay Wang
2026-09-23  8:27 ` [PATCH bpf-next 0/6] bpf: make the vmlinux BTF an on-demand loadable module (CONFIG_DEBUG_INFO_BTF=m) to save ~5.4 MB memory Alan Maguire
2026-09-25 21:23   ` Jay Wang

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=9ae62cc7c8da94b68778bfd040a658730a7b098ddc64f6d23d9a4a895f71b994@mail.kernel.org \
    --to=bot+bpf-ci@kernel.org \
    --cc=abuehaze@amazon.com \
    --cc=alan.maguire@oracle.com \
    --cc=andrii@kernel.org \
    --cc=arnd@arndb.de \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=doebel@amazon.de \
    --cc=eddyz87@gmail.com \
    --cc=ihor.solodrai@linux.dev \
    --cc=jay.wang.upstream@gmail.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=martin.lau@kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=mason@kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=memxor@gmail.com \
    --cc=nathan@kernel.org \
    --cc=nsc@kernel.org \
    --cc=petr.pavlu@suse.com \
    --cc=wanjay@amazon.com \
    --cc=yonghong.song@linux.dev \
    /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

all inboxes | Powered by JetHome®