[patch net 0/2] mlxsw: couple of fixes

STALE3702d

4 messages, 2 authors, 2016-06-18 · open the first message on its own page

[patch net 0/2] mlxsw: couple of fixes

From: Jiri Pirko <jiri@resnulli.us>
Date: 2016-06-17 13:09:10

From: Jiri Pirko <redacted>

Couple of slowpath tx stats fixes for Spectrum and SwitchX-2.

Nogah Frankel (2):
  mlxsw: spectrum: Don't count internal TX header bytes to stats
  mlxsw: switchx2: Don't count internal TX header bytes to stats

 drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 6 +++++-
 drivers/net/ethernet/mellanox/mlxsw/switchx2.c | 5 ++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

-- 
2.5.5

[patch net 1/2] mlxsw: spectrum: Don't count internal TX header bytes to stats

From: Jiri Pirko <jiri@resnulli.us>
Date: 2016-06-17 13:09:12

From: Nogah Frankel <redacted>

Stop the SW TX counter from counting the TX header bytes
since they are not being sent out.

Fixes: 56ade8fe3fe1 ("mlxsw: spectrum: Add initial support for Spectrum ASIC")
Reviewed-by: Ido Schimmel <redacted>
Signed-off-by: Nogah Frankel <redacted>
Signed-off-by: Jiri Pirko <redacted>
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
index 6f9e3dd..660429e 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
@@ -408,7 +408,11 @@ static netdev_tx_t mlxsw_sp_port_xmit(struct sk_buff *skb,
 	}
 
 	mlxsw_sp_txhdr_construct(skb, &tx_info);
-	len = skb->len;
+	/* TX header is consumed by HW on the way so we shouldn't count its
+	 * bytes as being sent.
+	 */
+	len = skb->len - MLXSW_TXHDR_LEN;
+
 	/* Due to a race we might fail here because of a full queue. In that
 	 * unlikely case we simply drop the packet.
 	 */
-- 
2.5.5

[patch net 2/2] mlxsw: switchx2: Don't count internal TX header bytes to stats

From: Jiri Pirko <jiri@resnulli.us>
Date: 2016-06-17 13:09:13

From: Nogah Frankel <redacted>

Stop the SW TX counter from counting the TX header bytes
since they are not being sent out.

Fixes: e577516b9db3 ("mlxsw: Fix use-after-free bug in mlxsw_sx_port_xmit")
Signed-off-by: Nogah Frankel <redacted>
Reviewed-by: Ido Schimmel <redacted>
Signed-off-by: Jiri Pirko <redacted>
---
 drivers/net/ethernet/mellanox/mlxsw/switchx2.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/switchx2.c b/drivers/net/ethernet/mellanox/mlxsw/switchx2.c
index 3842eab..25f658b 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/switchx2.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/switchx2.c
@@ -316,7 +316,10 @@ static netdev_tx_t mlxsw_sx_port_xmit(struct sk_buff *skb,
 		}
 	}
 	mlxsw_sx_txhdr_construct(skb, &tx_info);
-	len = skb->len;
+	/* TX header is consumed by HW on the way so we shouldn't count its
+	 * bytes as being sent.
+	 */
+	len = skb->len - MLXSW_TXHDR_LEN;
 	/* Due to a race we might fail here because of a full queue. In that
 	 * unlikely case we simply drop the packet.
 	 */
-- 
2.5.5

Re: [patch net 0/2] mlxsw: couple of fixes

From: David Miller <davem@davemloft.net>
Date: 2016-06-18 04:58:24

From: Jiri Pirko <jiri@resnulli.us>
Date: Fri, 17 Jun 2016 15:09:04 +0200
Couple of slowpath tx stats fixes for Spectrum and SwitchX-2.
Series applied, thanks Jiri.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help