Commit ad17e7e9 authored by Wei Fang's avatar Wei Fang Committed by Jakub Kicinski
Browse files

net: fec: correct rx_bytes statistic for the case SHIFT16 is set



Two additional bytes in front of each frame received into the RX FIFO if
SHIFT16 is set, so we need to subtract the extra two bytes from pkt_len
to correct the statistic of rx_bytes.

Fixes: 3ac72b7b ("net: fec: align IP header in hardware")
Signed-off-by: default avatarWei Fang <wei.fang@nxp.com>
Reviewed-by: default avatarFrank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20251106021421.2096585-1-wei.fang@nxp.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 57531b34
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1835,6 +1835,8 @@ fec_enet_rx_queue(struct net_device *ndev, u16 queue_id, int budget)
		ndev->stats.rx_packets++;
		pkt_len = fec16_to_cpu(bdp->cbd_datlen);
		ndev->stats.rx_bytes += pkt_len;
		if (fep->quirks & FEC_QUIRK_HAS_RACC)
			ndev->stats.rx_bytes -= 2;

		index = fec_enet_get_bd_index(bdp, &rxq->bd);
		page = rxq->rx_skb_info[index].page;