Skip to content

Commit ad17e7e

Browse files
WeiFang-NXPkuba-moo
authored andcommitted
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: 3ac72b7 ("net: fec: align IP header in hardware") Signed-off-by: Wei Fang <wei.fang@nxp.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20251106021421.2096585-1-wei.fang@nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 57531b3 commit ad17e7e

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/net/ethernet/freescale/fec_main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1835,6 +1835,8 @@ fec_enet_rx_queue(struct net_device *ndev, u16 queue_id, int budget)
18351835
ndev->stats.rx_packets++;
18361836
pkt_len = fec16_to_cpu(bdp->cbd_datlen);
18371837
ndev->stats.rx_bytes += pkt_len;
1838+
if (fep->quirks & FEC_QUIRK_HAS_RACC)
1839+
ndev->stats.rx_bytes -= 2;
18381840

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

0 commit comments

Comments
 (0)