Home Home > GIT Browse > SLE15-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-02-14 11:43:02 +0100
committerTakashi Iwai <tiwai@suse.de>2019-02-14 11:43:09 +0100
commit8dceab134b0cba9e1283e36050d54f59971495c2 (patch)
treef14fd00fc9b519f3efbacc40a8c00a04c67a4d0f
parentdfd0ef0756521bc542982228df0f3a8c04d1077f (diff)
gianfar: Fix Rx byte accounting for ndev stats (bsc#1051510).
-rw-r--r--patches.fixes/gianfar-Fix-Rx-byte-accounting-for-ndev-stats.patch60
-rw-r--r--series.conf1
2 files changed, 61 insertions, 0 deletions
diff --git a/patches.fixes/gianfar-Fix-Rx-byte-accounting-for-ndev-stats.patch b/patches.fixes/gianfar-Fix-Rx-byte-accounting-for-ndev-stats.patch
new file mode 100644
index 0000000000..7b3b28f491
--- /dev/null
+++ b/patches.fixes/gianfar-Fix-Rx-byte-accounting-for-ndev-stats.patch
@@ -0,0 +1,60 @@
+From 590399ddf9561f2ed0839311c8ae1be21597ba68 Mon Sep 17 00:00:00 2001
+From: Claudiu Manoil <claudiu.manoil@nxp.com>
+Date: Tue, 27 Feb 2018 17:33:10 +0200
+Subject: [PATCH] gianfar: Fix Rx byte accounting for ndev stats
+Git-commit: 590399ddf9561f2ed0839311c8ae1be21597ba68
+Patch-mainline: v4.16-rc5
+References: bsc#1051510
+
+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>
+Acked-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ drivers/net/ethernet/freescale/gianfar.c | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
+index f5c87bd35fa1..f27f9bae1a4a 100644
+--- a/drivers/net/ethernet/freescale/gianfar.c
++++ b/drivers/net/ethernet/freescale/gianfar.c
+@@ -3063,9 +3063,6 @@ static void gfar_process_frame(struct net_device *ndev, struct sk_buff *skb)
+ if (ndev->features & NETIF_F_RXCSUM)
+ 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.
+ * Even if vlan rx accel is disabled, on some chips
+ * RXFCB_VLN is pseudo randomly set.
+@@ -3136,13 +3133,15 @@ int gfar_clean_rx_ring(struct gfar_priv_rx_q *rx_queue, int rx_work_limit)
+ continue;
+ }
+
++ gfar_process_frame(ndev, skb);
++
+ /* Increment the number of packets */
+ total_pkts++;
+ total_bytes += skb->len;
+
+ 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 */
+ napi_gro_receive(&rx_queue->grp->napi_rx, skb);
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index a2e10fa09e..85d3a2b249 100644
--- a/series.conf
+++ b/series.conf
@@ -13895,6 +13895,7 @@
patches.drivers/Bluetooth-btusb-Use-DMI-matching-for-QCA-reset_resum
patches.suse/net-ipv4-don-t-allow-setting-net.ipv4.route.min_pmtu.patch
patches.fixes/ip_gre-fix-IFLA_MTU-ignored-on-NEWLINK.patch
+ patches.fixes/gianfar-Fix-Rx-byte-accounting-for-ndev-stats.patch
patches.suse/s390-qeth-fix-overestimated-count-of-buffer-elements.patch
patches.arch/s390-qeth-fix-ip-removal-on-offline-cards.patch
patches.arch/s390-qeth-fix-double-free-on-ip-add-remove-race.patch