Commit bf449f35 authored by Hariprasad Kelam's avatar Hariprasad Kelam Committed by Jakub Kicinski
Browse files

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: 66208910 ("octeontx2-af: Support to retrieve CGX LMAC stats")
Signed-off-by: default avatarHariprasad Kelam <hkelam@marvell.com>
Link: https://patch.msgid.link/20250513071554.728922-1-hkelam@marvell.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 1bdea6fa
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -717,6 +717,11 @@ int cgx_get_rx_stats(void *cgxd, int lmac_id, int idx, u64 *rx_stat)

	if (!is_lmac_valid(cgx, lmac_id))
		return -ENODEV;

	/* pass lmac as 0 for CGX_CMR_RX_STAT9-12 */
	if (idx >= CGX_RX_STAT_GLOBAL_INDEX)
		lmac_id = 0;

	*rx_stat =  cgx_read(cgx, lmac_id, CGXX_CMRX_RX_STAT0 + (idx * 8));
	return 0;
}