浏览代码

Merge branch 'mlxsw-fixes'

Jiri Pirko says:

====================
mlxsw: couple of fixes

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

Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller 9 年之前
父节点
当前提交
b47ac27a1d
共有 2 个文件被更改,包括 9 次插入2 次删除
  1. 5 1
      drivers/net/ethernet/mellanox/mlxsw/spectrum.c
  2. 4 1
      drivers/net/ethernet/mellanox/mlxsw/switchx2.c

+ 5 - 1
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);
 	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
 	/* Due to a race we might fail here because of a full queue. In that
 	 * unlikely case we simply drop the packet.
 	 * unlikely case we simply drop the packet.
 	 */
 	 */

+ 4 - 1
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);
 	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
 	/* Due to a race we might fail here because of a full queue. In that
 	 * unlikely case we simply drop the packet.
 	 * unlikely case we simply drop the packet.
 	 */
 	 */