* [PATCH] net: octeontx2: fix building without DEBUGFS
@ 2026-10-27 15:17 Arnd Bergmann
2026-10-27 15:54 ` Arnd Bergmann
2026-10-28 18:17 ` netdev-bot+sashiko
0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2026-10-27 15:17 UTC (permalink / raw)
To: Sunil Goutham, Ratheesh Kannoth, Geetha sowjanya,
Subbaraya Sundeep, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni
Cc: Arnd Bergmann, Suman Ghosh, Nitin Shetty J, Hariprasad Kelam,
Jiangshan Yi, netdev, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
This error came up on my randconfig tests this week:
drivers/net/ethernet/marvell/octeontx2/af/cn20k/debugfs.c: In function 'npc_cn20k_debugfs_init':
drivers/net/ethernet/marvell/octeontx2/af/cn20k/debugfs.c:392:55: error: 'struct rvu' has no member named 'rvu_dbg'; did you mean 'rvu_dl'?
392 | debugfs_create_file("mcam_layout", 0444, rvu->rvu_dbg.npc,
The problem here is that the rvu_dbg member is hidden in an #ifdef
block, but the reference to it is not.
Remove the #ifdef and waste the 8 bytes in the structure in this
config. Note that the debugfs_create_file() call end up ignoring
the arguments, so the actual debugfs implementation is still
ignored here.
Fixes: 45229e9a9ab5 ("octeontx2-af: Extend debugfs support for cn20k NIX")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
I cannot tell why this showed up now and not earlier, so maybe the
'Fixes' line is misplaced. In randconfig builds, debugfs is almost
always selected by something else, while the octeontx2 driver is
usually disabled, so it does make some sense that this config
would be rate.
---
drivers/net/ethernet/marvell/octeontx2/af/rvu.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu.h b/drivers/net/ethernet/marvell/octeontx2/af/rvu.h
index fb4870cd18e9..3b647e7b4bc2 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu.h
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu.h
@@ -649,9 +649,7 @@ struct rvu {
int mcs_blk_cnt;
int cpt_pf_num;
-#ifdef CONFIG_DEBUG_FS
struct rvu_debugfs rvu_dbg;
-#endif
struct rvu_devlink *rvu_dl;
/* RVU switch implementation over NPC with DMAC rules */
--
2.53.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] net: octeontx2: fix building without DEBUGFS
2026-10-27 15:17 [PATCH] net: octeontx2: fix building without DEBUGFS Arnd Bergmann
@ 2026-10-27 15:54 ` Arnd Bergmann
2026-10-28 18:17 ` netdev-bot+sashiko
1 sibling, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2026-10-27 15:54 UTC (permalink / raw)
To: Arnd Bergmann, Sunil Goutham, Ratheesh Kannoth, Geetha sowjanya,
Subbaraya Sundeep Bhatta, Andrew Lunn, David S . Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: Suman Ghosh, Nitin Shetty J, hariprasad, Jiangshan Yi, Netdev,
linux-kernel
On Tue, Oct 27, 2026, at 16:17, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> This error came up on my randconfig tests this week:
>
> drivers/net/ethernet/marvell/octeontx2/af/cn20k/debugfs.c: In function
> 'npc_cn20k_debugfs_init':
> drivers/net/ethernet/marvell/octeontx2/af/cn20k/debugfs.c:392:55:
> error: 'struct rvu' has no member named 'rvu_dbg'; did you mean
> 'rvu_dl'?
> 392 | debugfs_create_file("mcam_layout", 0444,
> rvu->rvu_dbg.npc,
>
Please ignore this patch, it was not the correct version. I'll send v2.
Arnd
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] net: octeontx2: fix building without DEBUGFS
2026-10-27 15:17 [PATCH] net: octeontx2: fix building without DEBUGFS Arnd Bergmann
2026-10-27 15:54 ` Arnd Bergmann
@ 2026-10-28 18:17 ` netdev-bot+sashiko
1 sibling, 0 replies; 3+ messages in thread
From: netdev-bot+sashiko @ 2026-10-28 18:17 UTC (permalink / raw)
To: arnd
Cc: sgoutham, rkannoth, gakula, sbhatta, andrew+netdev, davem,
edumazet, kuba, pabeni, arnd, sumang, nshettyj, hkelam,
yijiangshan, netdev, linux-kernel
Thank you for your contribution! Sashiko AI review found 3 potential
issue(s) to consider.
Critical: 0 · High: 1 · Medium: 0 · Low: 2
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [High] The patch does not fix the CONFIG_DEBUG_FS=n build.
- [Low] The Fixes tag points to the wrong commit.
- [Low] The commit message says making the member unconditional will
"waste the 8 bytes in the structure in this config".
--
net: octeontx2: fix building without DEBUGFS
This commit removes the CONFIG_DEBUG_FS guard around the rvu_dbg member
of struct rvu. The goal is to let the rvu->rvu_dbg.npc references in
cn20k/debugfs.c build when debugfs is disabled.
> Remove the #ifdef and waste the 8 bytes in the structure in this
> config.
[Severity: Low]
Is the 8 byte figure accurate? rvu_dbg is embedded in struct rvu by
value, not as a pointer.
struct rvu_debugfs contains 12 struct dentry pointers, 6 struct dump_ctx,
a cpt_ctx[MAX_CPT_BLKS] array (MAX_CPT_BLKS is 2) and two ints:
struct rvu_debugfs {
struct dentry *root;
...
struct dump_ctx nix_tm_ctx;
struct cpt_ctx cpt_ctx[MAX_CPT_BLKS];
int npa_qsize_id;
int nix_qsize_id;
};
That comes to about 208 bytes on 64-bit.
> Fixes: 45229e9a9ab5 ("octeontx2-af: Extend debugfs support for cn20k NIX")
[Severity: Low]
Is this the right commit for the Fixes tag?
At 45229e9a9ab5, rvu_debugfs.c holds the only references to rvu_dbg, and
that file is fully wrapped in #ifdef CONFIG_DEBUG_FS. At that point
cn20k/debugfs.c contained only seq_file print helpers.
The always-built cn20k/debugfs.c seems to have first referenced
rvu->rvu_dbg in 1396771b0b7741 ("octeontx2-af: npc: cn20k: Index
management"), which added:
void npc_cn20k_debugfs_deinit(struct rvu *rvu)
{
debugfs_remove_recursive(rvu->rvu_dbg.npc);
}
The debugfs_create_file() call quoted in the error message came later,
in 1100af13fd14b5. That may also explain why the error only showed up
recently.
> diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu.h b/drivers/net/ethernet/marvell/octeontx2/af/rvu.h
> index fb4870cd18e9e..3b647e7b4bc20 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu.h
> +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu.h
> @@ -649,9 +649,7 @@ struct rvu {
> int mcs_blk_cnt;
> int cpt_pf_num;
>
> -#ifdef CONFIG_DEBUG_FS
> struct rvu_debugfs rvu_dbg;
> -#endif
[Severity: High]
Does this build with CONFIG_DEBUG_FS=n?
The definition of struct rvu_debugfs is still inside an
#ifdef CONFIG_DEBUG_FS block earlier in rvu.h, with no #else. So are the
struct dump_ctx and struct cpt_ctx types it embeds:
#ifdef CONFIG_DEBUG_FS
struct dump_ctx {
...
struct rvu_debugfs {
struct dentry *root;
...
int nix_qsize_id;
};
#endif
With OCTEONTX2_AF enabled and DEBUG_FS disabled, struct rvu now has a
by-value member of incomplete type. The compiler would reject that with
"field 'rvu_dbg' has incomplete type".
Every rvu_af object includes rvu.h (rvu.o, rvu_nix.o, rvu_npc.o,
cn20k/*.o, ...). Wouldn't this turn the one error in cn20k/debugfs.c into
a failure in every rvu_af translation unit?
OCTEONTX2_AF does not depend on DEBUG_FS in octeontx2/Kconfig, so this
config can be selected.
Would either of these work instead?
- Move the #ifdef CONFIG_DEBUG_FS so that dump_ctx, cpt_ctx and
rvu_debugfs are always defined.
- Build cn20k/debugfs.o only when CONFIG_DEBUG_FS is set.
The Makefile currently builds cn20k/debugfs.o unconditionally:
rvu_af-y := cgx.o rvu.o rvu_cgx.o rvu_npa.o rvu_nix.o \
...
rvu_rep.o cn20k/mbox_init.o cn20k/nix.o cn20k/debugfs.o \
> struct rvu_devlink *rvu_dl;
>
> /* RVU switch implementation over NPC with DMAC rules */
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261027151737.386155-1-arnd%40kernel.org
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-10-28 18:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-27 15:17 [PATCH] net: octeontx2: fix building without DEBUGFS Arnd Bergmann
2026-10-27 15:54 ` Arnd Bergmann
2026-10-28 18:17 ` netdev-bot+sashiko
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®