OSDN Git Service

gianfar: Fix Rx byte accounting for ndev stats
authorClaudiu Manoil <claudiu.manoil@nxp.com>
Tue, 27 Feb 2018 15:33:10 +0000 (17:33 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 May 2018 05:49:02 +0000 (07:49 +0200)
commit36e7b814c9eb6481f99ff63776cd66e481624e8d
tree8aebec2df951a6c77a3dfb32ff7b9f9f73e70d26
parentfac4749afebe9496f483a6ef64993c456e520eeb
gianfar: Fix Rx byte accounting for ndev stats

[ Upstream commit 590399ddf9561f2ed0839311c8ae1be21597ba68 ]

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 d903ec77118c ("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: Claudiu Manoil <claudiu.manoil@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/freescale/gianfar.c