aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2014-06-02 03:18:48 -0400
committerDavid S. Miller <davem@davemloft.net>2014-06-02 03:18:48 -0400
commit96b2e73c5471542cb9c622c4360716684f8797ed (patch)
tree8afddc81c11b89232a32ade9f51d25619de337fb
parentd64eed1d9bb57fb7a8daf9b6127dd8b558e6d262 (diff)
Revert "net/mlx4_en: Use affinity hint"
This reverts commit 70a640d0dae3a9b1b222ce673eb5d92c263ddd61. Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/infiniband/hw/mlx4/main.c2
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/en_cq.c6
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/en_netdev.c30
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/eq.c13
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/mlx4_en.h1
-rw-r--r--include/linux/mlx4/device.h2
6 files changed, 4 insertions, 50 deletions
diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
index 58b1f239ac2b..199c7896f081 100644
--- a/drivers/infiniband/hw/mlx4/main.c
+++ b/drivers/infiniband/hw/mlx4/main.c
@@ -1897,7 +1897,7 @@ static void mlx4_ib_alloc_eqs(struct mlx4_dev *dev, struct mlx4_ib_dev *ibdev)
1897 i, j, dev->pdev->bus->name); 1897 i, j, dev->pdev->bus->name);
1898 /* Set IRQ for specific name (per ring) */ 1898 /* Set IRQ for specific name (per ring) */
1899 if (mlx4_assign_eq(dev, name, NULL, 1899 if (mlx4_assign_eq(dev, name, NULL,
1900 &ibdev->eq_table[eq], NULL)) { 1900 &ibdev->eq_table[eq])) {
1901 /* Use legacy (same as mlx4_en driver) */ 1901 /* Use legacy (same as mlx4_en driver) */
1902 pr_warn("Can't allocate EQ %d; reverting to legacy\n", eq); 1902 pr_warn("Can't allocate EQ %d; reverting to legacy\n", eq);
1903 ibdev->eq_table[eq] = 1903 ibdev->eq_table[eq] =
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_cq.c b/drivers/net/ethernet/mellanox/mlx4/en_cq.c
index ea2cd72e5368..636963db598a 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_cq.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_cq.c
@@ -118,15 +118,11 @@ int mlx4_en_activate_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq,
118 if (cq->is_tx == RX) { 118 if (cq->is_tx == RX) {
119 if (mdev->dev->caps.comp_pool) { 119 if (mdev->dev->caps.comp_pool) {
120 if (!cq->vector) { 120 if (!cq->vector) {
121 struct mlx4_en_rx_ring *ring =
122 priv->rx_ring[cq->ring];
123
124 sprintf(name, "%s-%d", priv->dev->name, 121 sprintf(name, "%s-%d", priv->dev->name,
125 cq->ring); 122 cq->ring);
126 /* Set IRQ for specific name (per ring) */ 123 /* Set IRQ for specific name (per ring) */
127 if (mlx4_assign_eq(mdev->dev, name, rmap, 124 if (mlx4_assign_eq(mdev->dev, name, rmap,
128 &cq->vector, 125 &cq->vector)) {
129 ring->affinity_mask)) {
130 cq->vector = (cq->ring + 1 + priv->port) 126 cq->vector = (cq->ring + 1 + priv->port)
131 % mdev->dev->caps.num_comp_vectors; 127 % mdev->dev->caps.num_comp_vectors;
132 mlx4_warn(mdev, "Failed assigning an EQ to %s, falling back to legacy EQ's\n", 128 mlx4_warn(mdev, "Failed assigning an EQ to %s, falling back to legacy EQ's\n",
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index 05d135572abc..58209bd0c94c 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -1526,32 +1526,6 @@ static void mlx4_en_linkstate(struct work_struct *work)
1526 mutex_unlock(&mdev->state_lock); 1526 mutex_unlock(&mdev->state_lock);
1527} 1527}
1528 1528
1529static void mlx4_en_init_affinity_hint(struct mlx4_en_priv *priv, int ring_idx)
1530{
1531 struct mlx4_en_rx_ring *ring = priv->rx_ring[ring_idx];
1532 int numa_node = priv->mdev->dev->numa_node;
1533
1534 if (numa_node == -1)
1535 return;
1536
1537 if (!zalloc_cpumask_var(&ring->affinity_mask, GFP_KERNEL)) {
1538 en_err(priv, "Failed to allocate core mask\n");
1539 return;
1540 }
1541
1542 if (cpumask_set_cpu_local_first(ring_idx, numa_node,
1543 ring->affinity_mask)) {
1544 en_err(priv, "Failed setting affinity hint\n");
1545 free_cpumask_var(ring->affinity_mask);
1546 ring->affinity_mask = NULL;
1547 }
1548}
1549
1550static void mlx4_en_free_affinity_hint(struct mlx4_en_priv *priv, int ring_idx)
1551{
1552 free_cpumask_var(priv->rx_ring[ring_idx]->affinity_mask);
1553 priv->rx_ring[ring_idx]->affinity_mask = NULL;
1554}
1555 1529
1556int mlx4_en_start_port(struct net_device *dev) 1530int mlx4_en_start_port(struct net_device *dev)
1557{ 1531{
@@ -1593,8 +1567,6 @@ int mlx4_en_start_port(struct net_device *dev)
1593 1567
1594 mlx4_en_cq_init_lock(cq); 1568 mlx4_en_cq_init_lock(cq);
1595 1569
1596 mlx4_en_init_affinity_hint(priv, i);
1597
1598 err = mlx4_en_activate_cq(priv, cq, i); 1570 err = mlx4_en_activate_cq(priv, cq, i);
1599 if (err) { 1571 if (err) {
1600 en_err(priv, "Failed activating Rx CQ\n"); 1572 en_err(priv, "Failed activating Rx CQ\n");
@@ -1875,8 +1847,6 @@ void mlx4_en_stop_port(struct net_device *dev, int detach)
1875 msleep(1); 1847 msleep(1);
1876 mlx4_en_deactivate_rx_ring(priv, priv->rx_ring[i]); 1848 mlx4_en_deactivate_rx_ring(priv, priv->rx_ring[i]);
1877 mlx4_en_deactivate_cq(priv, cq); 1849 mlx4_en_deactivate_cq(priv, cq);
1878
1879 mlx4_en_free_affinity_hint(priv, i);
1880 } 1850 }
1881} 1851}
1882 1852
diff --git a/drivers/net/ethernet/mellanox/mlx4/eq.c b/drivers/net/ethernet/mellanox/mlx4/eq.c
index f91659e5fa13..d954ec1eac17 100644
--- a/drivers/net/ethernet/mellanox/mlx4/eq.c
+++ b/drivers/net/ethernet/mellanox/mlx4/eq.c
@@ -1376,7 +1376,7 @@ int mlx4_test_interrupts(struct mlx4_dev *dev)
1376EXPORT_SYMBOL(mlx4_test_interrupts); 1376EXPORT_SYMBOL(mlx4_test_interrupts);
1377 1377
1378int mlx4_assign_eq(struct mlx4_dev *dev, char *name, struct cpu_rmap *rmap, 1378int mlx4_assign_eq(struct mlx4_dev *dev, char *name, struct cpu_rmap *rmap,
1379 int *vector, cpumask_var_t cpu_hint_mask) 1379 int *vector)
1380{ 1380{
1381 1381
1382 struct mlx4_priv *priv = mlx4_priv(dev); 1382 struct mlx4_priv *priv = mlx4_priv(dev);
@@ -1411,15 +1411,6 @@ int mlx4_assign_eq(struct mlx4_dev *dev, char *name, struct cpu_rmap *rmap,
1411 } 1411 }
1412 mlx4_assign_irq_notifier(priv, dev, 1412 mlx4_assign_irq_notifier(priv, dev,
1413 priv->eq_table.eq[vec].irq); 1413 priv->eq_table.eq[vec].irq);
1414 if (cpu_hint_mask) {
1415 err = irq_set_affinity_hint(
1416 priv->eq_table.eq[vec].irq,
1417 cpu_hint_mask);
1418 if (err) {
1419 mlx4_warn(dev, "Failed setting affinity hint\n");
1420 /*we dont want to break here*/
1421 }
1422 }
1423 1414
1424 eq_set_ci(&priv->eq_table.eq[vec], 1); 1415 eq_set_ci(&priv->eq_table.eq[vec], 1);
1425 } 1416 }
@@ -1450,8 +1441,6 @@ void mlx4_release_eq(struct mlx4_dev *dev, int vec)
1450 irq_set_affinity_notifier( 1441 irq_set_affinity_notifier(
1451 priv->eq_table.eq[vec].irq, 1442 priv->eq_table.eq[vec].irq,
1452 NULL); 1443 NULL);
1453 irq_set_affinity_hint(priv->eq_table.eq[vec].irq,
1454 NULL);
1455 free_irq(priv->eq_table.eq[vec].irq, 1444 free_irq(priv->eq_table.eq[vec].irq,
1456 &priv->eq_table.eq[vec]); 1445 &priv->eq_table.eq[vec]);
1457 priv->msix_ctl.pool_bm &= ~(1ULL << i); 1446 priv->msix_ctl.pool_bm &= ~(1ULL << i);
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
index 0e15295bedd6..b5db1bf361dc 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
+++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
@@ -313,7 +313,6 @@ struct mlx4_en_rx_ring {
313 unsigned long csum_ok; 313 unsigned long csum_ok;
314 unsigned long csum_none; 314 unsigned long csum_none;
315 int hwtstamp_rx_filter; 315 int hwtstamp_rx_filter;
316 cpumask_var_t affinity_mask;
317}; 316};
318 317
319struct mlx4_en_cq { 318struct mlx4_en_cq {
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index b9b70e00e3c1..ca38871a585c 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -1161,7 +1161,7 @@ int mlx4_fmr_free(struct mlx4_dev *dev, struct mlx4_fmr *fmr);
1161int mlx4_SYNC_TPT(struct mlx4_dev *dev); 1161int mlx4_SYNC_TPT(struct mlx4_dev *dev);
1162int mlx4_test_interrupts(struct mlx4_dev *dev); 1162int mlx4_test_interrupts(struct mlx4_dev *dev);
1163int mlx4_assign_eq(struct mlx4_dev *dev, char *name, struct cpu_rmap *rmap, 1163int mlx4_assign_eq(struct mlx4_dev *dev, char *name, struct cpu_rmap *rmap,
1164 int *vector, cpumask_t *cpu_hint_mask); 1164 int *vector);
1165void mlx4_release_eq(struct mlx4_dev *dev, int vec); 1165void mlx4_release_eq(struct mlx4_dev *dev, int vec);
1166 1166
1167int mlx4_get_phys_port_id(struct mlx4_dev *dev); 1167int mlx4_get_phys_port_id(struct mlx4_dev *dev);