summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/mellanox/mlx4/en_cq.c
diff options
context:
space:
mode:
authorTariq Toukan <tariqt@mellanox.com>2016-11-02 17:12:24 +0200
committerDavid S. Miller <davem@davemloft.net>2016-11-02 15:07:11 -0400
commit67f8b1dcb9ee7f1e165da4eb2ec53483a6b141ea (patch)
treebb2be58dee54bf94595e5f177ebe10de4dbf9e4f /drivers/net/ethernet/mellanox/mlx4/en_cq.c
parentccc109b8ed24c6a84cc46a78ec3df9a57a6c674a (diff)
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_cq.c')
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/en_cq.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_cq.c b/drivers/net/ethernet/mellanox/mlx4/en_cq.c
index 1427311a9640..03f05c4d1f98 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_cq.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_cq.c
@@ -127,15 +127,7 @@ int mlx4_en_activate_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq,
/* For TX we use the same irq per
ring we assigned for the RX */
struct mlx4_en_cq *rx_cq;
- int xdp_index;
-
- /* The xdp tx irq must align with the rx ring that forwards to
- * it, so reindex these from 0. This should only happen when
- * tx_ring_num is not a multiple of rx_ring_num.
- */
- xdp_index = (priv->xdp_ring_num - priv->tx_ring_num) + cq_idx;
- if (xdp_index >= 0)
- cq_idx = xdp_index;
+
cq_idx = cq_idx % priv->rx_ring_num;
rx_cq = priv->rx_cq[cq_idx];
cq->vector = rx_cq->vector;