From: Alan Maguire <alan.maguire@oracle.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>,
Eduard Zingerman <eddyz87@gmail.com>
Cc: Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>,
Martin KaFai Lau <martin.lau@linux.dev>,
Kumar Kartikeya Dwivedi <memxor@gmail.com>,
Song Liu <song@kernel.org>,
Yonghong Song <yonghong.song@linux.dev>,
Jiri Olsa <jolsa@kernel.org>, bpf <bpf@vger.kernel.org>,
Kaitao Cheng <pilgrimtao@gmail.com>
Subject: Re: [PATCH bpf-next] Fix undefined symbol references for module build post cnum changes
Date: Wed, 29 Apr 2026 18:10:19 +0100 [thread overview]
Message-ID: <306beaf8-48e9-496a-a42e-9bae2ce293b0@oracle.com> (raw)
In-Reply-To: <CAADnVQKuCr-w0d34vPyU=G8NHHiV7GkEY+=QPUSQmSm_nkWv+A@mail.gmail.com>
On 27/04/2026 18:11, Alexei Starovoitov wrote:
> On Mon, Apr 27, 2026 at 6:07 PM Eduard Zingerman <eddyz87@gmail.com> wrote:
>>
>> On Mon, 2026-04-27 at 09:44 -0700, Eduard Zingerman wrote:
>>> On Mon, 2026-04-27 at 12:22 +0100, Alan Maguire wrote:
>>>> Seeing the following on bpf-next:
>>>>
>>>> DESCEND objtool
>>>> DESCEND bpf/resolve_btfids
>>>> INSTALL libsubcmd_headers
>>>> INSTALL libsubcmd_headers
>>>> MODPOST Module.symvers
>>>> ERROR: modpost: "cnum64_umin" [drivers/net/ethernet/netronome/nfp/nfp.ko] undefined!
>>>> ERROR: modpost: "cnum64_umax" [drivers/net/ethernet/netronome/nfp/nfp.ko] undefined!
>>>> make[2]: *** [scripts/Makefile.modpost:147: Module.symvers] Error 1
>>>> make[1]: *** [bpf-next/Makefile:2089: modpost] Error 2
>>>> make: *** [Makefile:248: __sub-make] Error 2
>>>>
>>>> Further investigation suggests nfp indeed does pull in those symbols,
>>>> likely due to references in include/linux/bpf_verifier.h:
>>>>
>>>> static inline s64 reg_smax(const struct bpf_reg_state *reg)
>>>> {
>>>> return cnum64_smax(reg->r64);
>>>> }
>>>>
>>>> static inline u64 reg_umin(const struct bpf_reg_state *reg)
>>>> {
>>>> return cnum64_umin(reg->r64);
>>>> }
>>>>
>>>> ...
>>>>
>>>> Export symbols for these references.
>>>>
>>>> Reported-by: Kaitao Cheng <pilgrimtao@gmail.com>
>>>> Fixes: bbc631085503 ("bpf: replace min/max fields with struct cnum{32,64}")
>>>> Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
>>>> ---
>>>
>>> Hi Alan,
>>>
>>> thank you for the fix, apologies for breaking this.
>>>
>>> Acked-by: Eduard Zingerman <eddyz87@gmail.com>
>>
>> However, Alexei raises a valid question.
>> Netronome code uses the following accessors:
>> - cnum{32,64}_reg_umin
>> - cnum{32,64}_reg_umax
>>
>> However, this patch also exports the following on top:
>> - cnum{32,64}_from_{urange,srange}
>> - cnum{32,64}_reg_smin
>> - cnum{32,64}_reg_smax
>>
>> Why export extra accessors?
>
> I left only 2 while applying and rewrote commit log.
Yep, I just added the accessors as they are potentially available to consumers
via bpf_verifier.h. No actual users today though as far as I could see. Thanks!
prev parent reply other threads:[~2026-04-29 17:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-27 11:22 [PATCH bpf-next] Fix undefined symbol references for module build post cnum changes Alan Maguire
2026-04-27 12:08 ` Chengkaitao
2026-04-27 16:44 ` Eduard Zingerman
2026-04-27 17:07 ` Eduard Zingerman
2026-04-27 17:11 ` Alexei Starovoitov
2026-04-29 17:10 ` Alan Maguire [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=306beaf8-48e9-496a-a42e-9bae2ce293b0@oracle.com \
--to=alan.maguire@oracle.com \
--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=jolsa@kernel.org \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.com \
--cc=pilgrimtao@gmail.com \
--cc=song@kernel.org \
--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