Skip to content

Commit bf449f3

Browse files
Hariprasad Kelamkuba-moo
authored andcommitted
octeontx2-af: Fix CGX Receive counters
Each CGX block supports 4 logical MACs (LMACS). Receive counters CGX_CMR_RX_STAT0-8 are per LMAC and CGX_CMR_RX_STAT9-12 are per CGX. Due a bug in previous patch, stale Per CGX counters values observed. Fixes: 6620891 ("octeontx2-af: Support to retrieve CGX LMAC stats") Signed-off-by: Hariprasad Kelam <hkelam@marvell.com> Link: https://patch.msgid.link/20250513071554.728922-1-hkelam@marvell.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 1bdea6f commit bf449f3

File tree

1 file changed

+5
-0
lines changed
  • drivers/net/ethernet/marvell/octeontx2/af

1 file changed

+5
-0
lines changed

drivers/net/ethernet/marvell/octeontx2/af/cgx.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,11 @@ int cgx_get_rx_stats(void *cgxd, int lmac_id, int idx, u64 *rx_stat)
717717

718718
if (!is_lmac_valid(cgx, lmac_id))
719719
return -ENODEV;
720+
721+
/* pass lmac as 0 for CGX_CMR_RX_STAT9-12 */
722+
if (idx >= CGX_RX_STAT_GLOBAL_INDEX)
723+
lmac_id = 0;
724+
720725
*rx_stat = cgx_read(cgx, lmac_id, CGXX_CMRX_RX_STAT0 + (idx * 8));
721726
return 0;
722727
}

0 commit comments

Comments
 (0)