diff options
author | Tariq Toukan <tariqt@mellanox.com> | 2016-11-02 18:12:24 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-11-02 22:07:11 +0300 |
commit | 67f8b1dcb9ee7f1e165da4eb2ec53483a6b141ea (patch) | |
tree | bb2be58dee54bf94595e5f177ebe10de4dbf9e4f /drivers/net/ethernet/mellanox/mlx4/en_port.c | |
parent | ccc109b8ed24c6a84cc46a78ec3df9a57a6c674a (diff) | |
download | linux-67f8b1dcb9ee7f1e165da4eb2ec53483a6b141ea.tar.xz |
net/mlx4_en: Refactor the XDP forwarding rings scheme
Separately manage the two types of TX rings: regular ones, and XDP.
Upon an XDP set, do not borrow regular TX rings and convert them
into XDP ones, but allocate new ones, unless we hit the max number
of rings.
Which means that in systems with smaller #cores we will not consume
the current TX rings for XDP, while we are still in the num TX limit.
XDP TX rings counters are not shown in ethtool statistics.
Instead, XDP counters will be added to the respective RX rings
in a downstream patch.
This has no performance implications.
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4/en_port.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/en_port.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_port.c b/drivers/net/ethernet/mellanox/mlx4/en_port.c index 59473a0ebcdf..2e1ab4642569 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_port.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_port.c @@ -196,8 +196,8 @@ int mlx4_en_DUMP_ETH_STATS(struct mlx4_en_dev *mdev, u8 port, u8 reset) priv->port_stats.tso_packets = 0; priv->port_stats.xmit_more = 0; - for (i = 0; i < priv->tx_ring_num; i++) { - const struct mlx4_en_tx_ring *ring = priv->tx_ring[i]; + for (i = 0; i < priv->tx_ring_num[TX]; i++) { + const struct mlx4_en_tx_ring *ring = priv->tx_ring[TX][i]; stats->tx_packets += ring->packets; stats->tx_bytes += ring->bytes; |