diff options
author | Nogah Frankel <nogahf@mellanox.com> | 2016-06-17 15:09:05 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-05-10 10:26:00 +0200 |
commit | 0398b2f34d118a558e55228f928e991202eaa492 (patch) | |
tree | 51e1c33c6a2abe88d4af8722eaaf44518abefcd2 | |
parent | 4d1809cb8877a843ac4b83936450048a714e5802 (diff) | |
download | linux-stable-0398b2f34d118a558e55228f928e991202eaa492.tar.gz linux-stable-0398b2f34d118a558e55228f928e991202eaa492.tar.bz2 linux-stable-0398b2f34d118a558e55228f928e991202eaa492.zip |
mlxsw: spectrum: Don't count internal TX header bytes to stats
commit 63dcdd35c1552ca0c911e98ba3389a0729a457f4 upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 6 |
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 cb165c2d4803..0c4bf732567c 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c @@ -399,7 +399,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. */ |