BPF List
 help / color / mirror / Atom feed
From: Eduard Zingerman <eddyz87@gmail.com>
To: Alan Maguire <alan.maguire@oracle.com>, ast@kernel.org
Cc: daniel@iogearbox.net, andrii@kernel.org, martin.lau@linux.dev,
	 memxor@gmail.com, song@kernel.org, yonghong.song@linux.dev,
	jolsa@kernel.org, 	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: Mon, 27 Apr 2026 10:07:28 -0700	[thread overview]
Message-ID: <81b78478b1345151539578cd486b7c656249b441.camel@gmail.com> (raw)
In-Reply-To: <686d51d3081a3c34ce644ac6d52c8b8e41864192.camel@gmail.com>

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?

  reply	other threads:[~2026-04-27 17:07 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 [this message]
2026-04-27 17:11     ` Alexei Starovoitov
2026-04-29 17:10       ` Alan Maguire

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=81b78478b1345151539578cd486b7c656249b441.camel@gmail.com \
    --to=eddyz87@gmail.com \
    --cc=alan.maguire@oracle.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --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