Thread (8 messages) 8 messages, 2 authors, 26d ago

Re: [PATCH net v2] net: airoha: fix MIB stats collection to be lossless

From: Aniket Negi <hidden>
Date: 2026-07-02 06:22:03
Also in: linux-arm-kernel, linux-mediatek, lkml

quoted
Signed-off-by: Aniket Negi <redacted>
Hi Aniket,

just few nits inline. Fixing them:

Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Ok sure. I'll update.
quoted
+	dev->stats.mib_prev.tx_runt_cnt = val;
+
+	/* tx_len[0]: RUNT (32-bit, delta) + E64 (64-bit, absolute) → {0, 64} bucket.
+	 * Accumulate RUNT delta in tx_runt_accum64, then assign tx_len[0] as
+	 * accum + E64_abs so each call gives the correct combined total.
+	 */
no new-line here.
quoted
+
+	dev->stats.tx_len[i] = dev->stats.mib_prev.tx_runt_accum64;
Sure, You are reffering to both the spaces above and below comment section?. Same for rx_runt and rx_long/tx_long.

I'll update as following:
 +	dev->stats.mib_prev.tx_runt_cnt = val;
 +	/* tx_len[0]: RUNT (32-bit, delta) + E64 (64-bit, absolute) → {0, 64} bucket.
 +	 * Accumulate RUNT delta in tx_runt_accum64, then assign tx_len[0] as
 +	 * accum + E64_abs so each call gives the correct combined total.
 +	 */
 +	dev->stats.tx_len[i] = dev->stats.mib_prev.tx_runt_accum64;
quoted
+		u32 tx_drops;
+		u32 tx_broadcast;
+		u32 tx_multicast;
+		u32 tx_runt_cnt;
		u32 tx_runt;
quoted
+		u32 tx_long_cnt;
		u32 tx_long;
quoted
+		u64 tx_runt_accum64;
		64 tx_runt64;
quoted
+		u32 rx_drops;
+		u32 rx_broadcast;
+		u32 rx_multicast;
+		u32 rx_errors;
+		u32 rx_crc_error;
+		u32 rx_over_errors;
+		u32 rx_fragment;
+		u32 rx_jabber;
+		u32 rx_runt_cnt;
		u32 rx_runt;
quoted
+		u32 rx_long_cnt;
		u32 rx_long;
quoted
+		u64 rx_runt_accum64;
		u64 rx_runt64;
quoted
+	} mib_prev;
 };
Acked the change name from tx_runt_cnt to tx_run, tx_long_cnt to tx_long, tx_runt_accum64 to tx_runt64. Same for rx counters.

Best Regards,
Aniket Negi
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help