mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net v2] octeontx2-af: skip NPC_AF_MATCH_STATX access on cn20k
@ 2026-11-03  9:18 Vadluri Mukunda
  2026-11-06 12:09 ` Simon Horman
  2026-11-06 14:02 ` Nicolai Buchwitz
  0 siblings, 2 replies; 3+ messages in thread
From: Vadluri Mukunda @ 2026-11-03  9:18 UTC (permalink / raw)
  To: netdev, linux-kernel
  Cc: Sunil Goutham, Ratheesh Kannoth, Geetha sowjanya,
	Subbaraya Sundeep, Andrew Lunn, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Suman Ghosh, Vadluri Mukunda

From: Subbaraya Sundeep <sbhatta@marvell.com>

NPC_AF_MATCH_STATX is not present on cn20k silicon, and cn20k does
not set up an RX miss action counter. Two paths still access it:
the npc_delete_flow mailbox, which reads the counter of the deleted
rule, and the rx_miss_act_stats debugfs file, which would read
counter 0. Avoid the access on cn20k. Counter support for cn20k is
left for later.

Found by code inspection. The issue was not triggered on hardware.
Compile tested only; not tested on real hardware.

Fixes: 4e527f1e5c15 ("octeontx2-af: npc: cn20k: Add new mailboxes for CN20K silicon")
Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
Signed-off-by: Vadluri Mukunda <vmukunda@marvell.com>
---
v2:
  - Fixes tag now points to the upstream commit
  - Also skip creating the rx_miss_act_stats debugfs file on cn20k
  - Use full name in Signed-off-by
  - Add how the issue was found and what testing was done
v1: https://lore.kernel.org/netdev/20261026035140.666684-1-vmukunda@marvell.com/

 drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c | 6 ++++--
 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c  | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c
index 2927633465d9..119426beb946 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c
@@ -3740,8 +3740,10 @@ static void rvu_dbg_npc_init(struct rvu *rvu)
 	debugfs_create_file("mcam_rules", 0444, rvu->rvu_dbg.npc, rvu,
 			    &rvu_dbg_npc_mcam_rules_fops);
 
-	debugfs_create_file("rx_miss_act_stats", 0444, rvu->rvu_dbg.npc, rvu,
-			    &rvu_dbg_npc_rx_miss_act_fops);
+	/* RX miss action counter is not available on cn20k */
+	if (!is_cn20k(rvu->pdev))
+		debugfs_create_file("rx_miss_act_stats", 0444, rvu->rvu_dbg.npc,
+				    rvu, &rvu_dbg_npc_rx_miss_act_fops);
 
 	if (is_cn20k(rvu->pdev))
 		npc_cn20k_debugfs_init(rvu);
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c
index ea5d462a66ee..f3b0b082443b 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c
@@ -1960,7 +1960,7 @@ int rvu_mbox_handler_npc_delete_flow(struct rvu *rvu,
 			/* single rule */
 			} else if (req->entry == iter->entry) {
 				blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0);
-				if (blkaddr)
+				if (blkaddr && !is_cn20k(rvu->pdev))
 					rsp->cntr_val = rvu_read64(rvu, blkaddr,
 								   NPC_AF_MATCH_STATX(iter->cntr));
 				list_move_tail(&iter->list, &del_list);
-- 
2.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-06 14:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-03  9:18 [PATCH net v2] octeontx2-af: skip NPC_AF_MATCH_STATX access on cn20k Vadluri Mukunda
2026-11-06 12:09 ` Simon Horman
2026-11-06 14:02 ` Nicolai Buchwitz

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®