๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #8340

Re: [PATCH] net: octeontx2: fix building without DEBUGFS

#8340
From: netdev-bot+sashiko
Date: Wed, 28 Oct 2026 18:17
127 lines
11999 bytes
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
Technical Details
Message-ID: <179321145903.3134.9602070499142320900@kernel.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-352986-linux-kernel-netdev=dewy.ru
References: <20261027151737.386155-1-arnd@kernel.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-352986-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH] net: octeontx2: fix building without DEBUGFS
Date: Wed, 28 Oct 2026 18:17:39 +0000
Organization: Usenet Network
Message-ID: <179321145903.3134.9602070499142320900@kernel.org>
References: <20261027151737.386155-1-arnd@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1849504"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:XnnB1Dz+n97EuCP//j+TyWyjDhw= sha256:uDKOJUR0xyNRCPEUkF3oSa6m1D6xMLOHolmhzJfwfow=
	sha1:buNxxhNKnvKgImcV5KRS4sLn7sY= sha256:tC65WzxudgBm3cDZZ+H4pUKtR/YJBWnDPubPNPXjK/Q=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 086F1125C46; Wed, 28 Oct 2026 22:26:46 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id BWn9H-Pv3lJm;
	Wed, 28 Oct 2026 22:26:42 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-352986-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 1BFE4125C40; Wed, 28 Oct 2026 22:26:33 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id E17C629FBB; Wed, 28 Oct 2026 18:17:50 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1793211467;
	b=K/3mApvD0STkv2smL2h7Gp7F4pl3mwUjyHpDXPA67QCMLwerKbyjGDXBRA9ovnWLt6Xu
	 vq/xBa2L20AN/4gkSEmxJhwco3pbckXKPez7F3YmrquszlE8FMimPsuF6+UXoffuPnFcv
	 fXkpKg8uVj6Tvnq4qp8Bo12+YsCvitmLv6/nvRAWN2kb4OQ3p7+dOzo2qmcQotVXdd7zH
	 Ym2Mnfe2syumJEHey1COTvvLeIdyLxqnQjP4C0l+1c1sOOn51C9O1+C8dBI8T5GYSJNvB
	 5K+c7PUMe37yE74mr+GceiQD9FyZuKlKsAayGuubIfNB9uv3Hk5DQc4h1B0uKvU/04g==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793211467;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=aTB+qmr+k6hrfExn8YMUYkBKlFM/bzuSQoxuiUonvFM=;
	b=ng1wxjDeHoK0DQ5WzDEjBZ1hloWca4CRSd2/jWDXMZlCNkYd1qVYipk/T5Xb/iLMTxWI
	 xK/WQALQnmK7wwr/hkmSRzUHHRA+JecYSgl0WC8kMCpIH/l/91ujfCidMffgHqaOT9bPW
	 /ySmXtUTygRt8ZtheNOQEaSDIbRHYtYD4FOX9mRSFsQ8xcboY+TrktOKEWy8H2wDsLS3u
	 XeYcJnByfA/QgbQeQv5y3IgP8UrsiHw8+rJQY2Rp2A8WaDo68N/O/HxyXTanqQoQ7QLTE
	 OLQ8arrkoRNYkL1jPmxeEhaDyu5djKGk8JaqDO2c1m+UW8jO9FifJNw+e/32Opj7yjw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=DYt2jHLb;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id C8632606A333;
	Wed, 28 Oct 2026 18:17:47 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=DYt2jHLb
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793211460;
	b=Dc9IbsJ67eJzpd8v7JKMA5c6HAblr4WvPuw3tAr1zBhe2q343Xj3BBF6Rck3mioEAx32
	 Ax7SFD7YZfgDH7RqCykvd7uATQrqs/E+HYyIP4tE4iL44gAjIq5Qi8K+qA5wfoU8VccI/
	 jpu1vxZA+PT7ceOztiBgeHu+D4n93pznFHkGlHvwdQa6GSVa75QbgzBXQGPmTauzJEG7o
	 YLf/lMMw5QF2/Ru4FUSSdrFU3caQNRRPvi7Rf5krYxOvYqH+Suss/N0RBjsg7VzdSjOsq
	 XLaUi2BXkoAKhr3fVsoo28TNfryrJzoXST69tI47KKE0uJ61u1anD/a8CHm8+0Ld/4g==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793211460;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=aTB+qmr+k6hrfExn8YMUYkBKlFM/bzuSQoxuiUonvFM=;
	b=d4UGSi3+S+92CSbMGqBHKiHnpx74GGRTeIMm/CPslhvdwQR3SHEYMnG2Rn2CCMQKJfPN
	 Kkw55QUXcXHWjrMKeqiKBCaGi0aMV/J0+npB+an9h+9B35PC/8PUMFt2Rx30u1w3kxwDq
	 kctI21UUY6ZldquB/q98zQUS1+4S9fT2tbY5WEj3WB9q/l/DqbdUcJmRQlNDjQtUq9Lvu
	 Y+xuz93mgbNq3riq10eC+XwxQK3yTIcD1WLONW/vQfjeg6rBCae0BAVcn+pXFotFJb7cm
	 97vL8VPbX+vfS1T5pBkIl60VEQxPqWijFWIABWRv0PmPpU1W/VVloFrLTwes7L1qOAw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=DYt2jHLb;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 787E0606A31D;
	Wed, 28 Oct 2026 18:17:40 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7926B1F01825;
	Wed, 28 Oct 2026 18:17:39 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1793211460;
	bh=aTB+qmr+k6hrfExn8YMUYkBKlFM/bzuSQoxuiUonvFM=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=DYt2jHLb8pZDWRnfkToccjW+vE2T0iI7ivXTNIJNgxs91DqMaLoDImSYTgVI+Gh4H
	 wfRxWEHJe8UhpBiHByk44xOf39qW2vXEdFfr8YWZKeFEEkcze9xa12vHdKSh0aMWoa
	 eopEMcnFcqKxVmCjWLsM8CPcwdc3uplOAL1jYqyCeHfzCm8YjOeXS2cY8rvKkayZ9c
	 rMJUZ1boofElRx/0CKi+tU1iuHl8suzd+pIVB7/T+vHN0SDQo+uwiz9sAJjYN/jkVK
	 lOTNLWE7tvr+S4BkYCmRn28yYZoayVqTS26GACt+Lthd6v3KfbSgGdXNdJg46+43Eu
	 1Y4T4jX4gnvVg==
X-Cc: sgoutham@marvell.com, rkannoth@marvell.com, gakula@marvell.com,
 sbhatta@marvell.com, andrew+netdev@lunn.ch, davem@davemloft.net,
 edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, arnd@arndb.de,
 sumang@marvell.com, nshettyj@marvell.com, hkelam@marvell.com,
 yijiangshan@kylinos.cn, netdev@vger.kernel.org, linux-kernel@vger.kernel.org
X-In-Reply-To: <20261027151737.386155-1-arnd@kernel.org>
X-sashiko-severity: High
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list