aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlx4
diff options
context:
space:
mode:
authorAmir Vadai <amirv@mellanox.com>2013-03-06 22:46:57 -0500
committerDavid S. Miller <davem@davemloft.net>2013-03-07 15:52:04 -0500
commita229e488ac3f904d06c20d8d3f47831db3c7a15a (patch)
treeaea8161b5ec5c7f9ffa6aa6e001f5a3f5ac32603 /drivers/net/ethernet/mellanox/mlx4
parent83a5a6cef40616d19a388f560447e99c2ca04d1e (diff)
net/mlx4_en: Disable RFS when running in SRIOV mode
Commit 37706996 "mlx4_en: fix allocation of CPU affinity reverse-map" fixed a bug when mlx4_dev->caps.comp_pool is larger from the device rx rings, but introduced a regression. When the mlx4_core is activating its "legacy mode" (e.g when running in SRIOV mode) w.r.t to EQs/IRQs usage, comp_pool becomes zero and we're crashing on divide by zero alloc_cpu_rmap. Fix that by enabling RFS only when running in non-legacy mode. Reported-by: Yan Burman <yanb@mellanox.com> Cc: Kleber Sacilotto de Souza <klebers@linux.vnet.ibm.com> Signed-off-by: Amir Vadai <amirv@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4')
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/en_netdev.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index 7fd0936967c4..995d4b6d5c1e 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -1833,9 +1833,11 @@ int mlx4_en_alloc_resources(struct mlx4_en_priv *priv)
1833 } 1833 }
1834 1834
1835#ifdef CONFIG_RFS_ACCEL 1835#ifdef CONFIG_RFS_ACCEL
1836 priv->dev->rx_cpu_rmap = alloc_irq_cpu_rmap(priv->mdev->dev->caps.comp_pool); 1836 if (priv->mdev->dev->caps.comp_pool) {
1837 if (!priv->dev->rx_cpu_rmap) 1837 priv->dev->rx_cpu_rmap = alloc_irq_cpu_rmap(priv->mdev->dev->caps.comp_pool);
1838 goto err; 1838 if (!priv->dev->rx_cpu_rmap)
1839 goto err;
1840 }
1839#endif 1841#endif
1840 1842
1841 return 0; 1843 return 0;