octeontx2-af: skip NPC_AF_MATCH_STATX access on cn20k
PATCH v2 1/1 octeontx2-af: skip NPC_AF_MATCH_STATX access on cn20k
From: Subbaraya Sundeep <[email protected]>
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.
---
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/[email protected]/
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(-)
drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c +4 -2
@@ -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);
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c +1 -1
@@ -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);
Signature · 1 line
2.25.1
Quoted 15 lines · Vadluri Mukunda
From: Subbaraya Sundeep <[email protected]>
NPC_AF_MATCH_STATXis not present on cn20k silicon, and cn20k does not set up an RX miss action counter. Two paths still access it:
thenpc_delete_flowmailbox, which reads the counter of the deleted rule, and therx_miss_act_statsdebugfs 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 <[email protected]>Signed-off-by Vadluri Mukunda <[email protected]>
Quoted 7 lines
---
v2:
- Fixes tag now points to the upstream commit
- Also skip creating therx_miss_act_statsdebugfs 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/[email protected]/
Hi Vadluri
Quoted 11 lines · Vadluri Mukunda
From: Subbaraya Sundeep <[email protected]>
NPC_AF_MATCH_STATXis not present on cn20k silicon, and cn20k does not set up an RX miss action counter. Two paths still access it:
thenpc_delete_flowmailbox, which reads the counter of the deleted rule, and therx_miss_act_statsdebugfs 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.
What does the read do on cn20k, fault or just return garbage? If it is only the latter, with the recent discussion about routing non-critical fixes through net-next, this looks like net-next material to me?
Quoted 7 lines
Fixes 4e527f1e5c15 ("octeontx2-af: npc: cn20k: Add new mailboxes for CN20K silicon")Signed-off-by Subbaraya Sundeep <[email protected]>Signed-off-by Vadluri Mukunda <[email protected]>---
[...]
Thanks,
Nicolai
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 10 lines · On Tue, 3 Nov 2026 09:18:31 +0000 you wrote:
From: Subbaraya Sundeep <[email protected]>
NPC_AF_MATCH_STATXis not present on cn20k silicon, and cn20k does not set up an RX miss action counter. Two paths still access it:
thenpc_delete_flowmailbox, which reads the counter of the deleted rule, and therx_miss_act_statsdebugfs file, which would read counter 0. Avoid the access on cn20k. Counter support for cn20k is left for later.[...]
Here is the summary with links:
- [net,v2] octeontx2-af: skip NPC_AF_MATCH_STATX access on cn20k
https://git.kernel.org/netdev/net-next/c/4386ca0bf692
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html