Commit 19ccef5d authored by Claudiu Manoil's avatar Claudiu Manoil Committed by Khalid Elmously

gianfar: Fix Rx byte accounting for ndev stats

BugLink: https://bugs.launchpad.net/bugs/1775771

[ Upstream commit 590399dd ]

Don't include in the Rx bytecount of the packet sent up the stack:
the FCB (frame control block), and the padding bytes inserted by
the controller into the frame payload, nor the FCS. All these are
being pulled out of the skb by gfar_process_frame().
This issue is old, likely from the driver's beginnings, however
it was amplified by recent:
commit d903ec77 ("gianfar: simplify FCS handling and fix memory leak")
which basically added the FCS to the Rx bytecount, and so brought
this to my attention.
Signed-off-by: default avatarClaudiu Manoil <claudiu.manoil@nxp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarJuerg Haefliger <juergh@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent 5cfee2ea
...@@ -3053,9 +3053,6 @@ static void gfar_process_frame(struct net_device *ndev, struct sk_buff *skb) ...@@ -3053,9 +3053,6 @@ static void gfar_process_frame(struct net_device *ndev, struct sk_buff *skb)
if (ndev->features & NETIF_F_RXCSUM) if (ndev->features & NETIF_F_RXCSUM)
gfar_rx_checksum(skb, fcb); gfar_rx_checksum(skb, fcb);
/* Tell the skb what kind of packet this is */
skb->protocol = eth_type_trans(skb, ndev);
/* There's need to check for NETIF_F_HW_VLAN_CTAG_RX here. /* There's need to check for NETIF_F_HW_VLAN_CTAG_RX here.
* Even if vlan rx accel is disabled, on some chips * Even if vlan rx accel is disabled, on some chips
* RXFCB_VLN is pseudo randomly set. * RXFCB_VLN is pseudo randomly set.
...@@ -3126,13 +3123,15 @@ int gfar_clean_rx_ring(struct gfar_priv_rx_q *rx_queue, int rx_work_limit) ...@@ -3126,13 +3123,15 @@ int gfar_clean_rx_ring(struct gfar_priv_rx_q *rx_queue, int rx_work_limit)
continue; continue;
} }
gfar_process_frame(ndev, skb);
/* Increment the number of packets */ /* Increment the number of packets */
total_pkts++; total_pkts++;
total_bytes += skb->len; total_bytes += skb->len;
skb_record_rx_queue(skb, rx_queue->qindex); skb_record_rx_queue(skb, rx_queue->qindex);
gfar_process_frame(ndev, skb); skb->protocol = eth_type_trans(skb, ndev);
/* Send the packet up the stack */ /* Send the packet up the stack */
napi_gro_receive(&rx_queue->grp->napi_rx, skb); napi_gro_receive(&rx_queue->grp->napi_rx, skb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment