Skip to contentSkip to conversation

Patch "nfp: fix port stats for mac representors" has been added to the 4.14-stable tree

PATCH [email protected] 1 participant 1 message Feb 23, 2018

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

nfp: fix port stats for mac representors

to the 4.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
nfp-fix-port-stats-for-mac-representors.patch
and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Fri Feb 23 11:45:09 CET 2018

From: Pieter Jansen van Vuuren <[email protected]>
Date: Fri, 1 Dec 2017 21:37:23 -0800
Subject: nfp: fix port stats for mac representors

From: Pieter Jansen van Vuuren <[email protected]>

[ Upstream commit 42d779ffc186f6dd26271fc60a7417cb51aca93e ]

Previously we swapped the tx_packets, tx_bytes and tx_dropped counters with rx_packets, rx_bytes and rx_dropped counters, respectively. This behaviour is correct and expected for VF representors but it should not be swapped for physical port mac representors.

Fixes eadfa4c3be99 ("nfp: add stats and xmit helpers for representors")
---
 drivers/net/ethernet/netronome/nfp/nfp_net_repr.c |   15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)
drivers/net/ethernet/netronome/nfp/nfp_net_repr.c +6 -9
@@ -84,16 +84,13 @@ nfp_repr_phy_port_get_stats64(struct nfp
 {
 	u8 __iomem *mem = port->eth_stats;
 
-	/* TX and RX stats are flipped as we are returning the stats as seen
-	 * at the switch port corresponding to the phys port.
-	 */
-	stats->tx_packets = readq(mem + NFP_MAC_STATS_RX_FRAMES_RECEIVED_OK);
-	stats->tx_bytes = readq(mem + NFP_MAC_STATS_RX_IN_OCTETS);
-	stats->tx_dropped = readq(mem + NFP_MAC_STATS_RX_IN_ERRORS);
+	stats->tx_packets = readq(mem + NFP_MAC_STATS_TX_FRAMES_TRANSMITTED_OK);
+	stats->tx_bytes = readq(mem + NFP_MAC_STATS_TX_OUT_OCTETS);
+	stats->tx_dropped = readq(mem + NFP_MAC_STATS_TX_OUT_ERRORS);
 
-	stats->rx_packets = readq(mem + NFP_MAC_STATS_TX_FRAMES_TRANSMITTED_OK);
-	stats->rx_bytes = readq(mem + NFP_MAC_STATS_TX_OUT_OCTETS);
-	stats->rx_dropped = readq(mem + NFP_MAC_STATS_TX_OUT_ERRORS);
+	stats->rx_packets = readq(mem + NFP_MAC_STATS_RX_FRAMES_RECEIVED_OK);
+	stats->rx_bytes = readq(mem + NFP_MAC_STATS_RX_IN_OCTETS);
+	stats->rx_dropped = readq(mem + NFP_MAC_STATS_RX_IN_ERRORS);
 }
 
 static void

Patches currently in stable-queue which might be from [email protected] are

queue-4.14/nfp-fix-port-stats-for-mac-representors.patch