summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorNogah Frankel <nogahf@mellanox.com>2016-06-17 13:09:05 (GMT)
committerDavid S. Miller <davem@davemloft.net>2016-06-18 04:57:53 (GMT)
commit63dcdd35c1552ca0c911e98ba3389a0729a457f4 (patch)
tree9fd85b5cd7cc9f3da8ac9e7674512154926808b3 /drivers
parentf1d048f24e66ba85d3dabf3d076cefa5f2b546b0 (diff)
downloadlinux-63dcdd35c1552ca0c911e98ba3389a0729a457f4.tar.xz
mlxsw: spectrum: Don't count internal TX header bytes to stats
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 <idosch@mellanox.com> Signed-off-by: Nogah Frankel <nogahf@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/spectrum.c6
1 files changed, 5 insertions, 1 deletions
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.
*/