Skip to content

Commit a229e48

Browse files
amirvdavem330
authored andcommitted
net/mlx4_en: Disable RFS when running in SRIOV mode
Commit 3770699 "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>
1 parent 83a5a6c commit a229e48

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

drivers/net/ethernet/mellanox/mlx4/en_netdev.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1833,9 +1833,11 @@ int mlx4_en_alloc_resources(struct mlx4_en_priv *priv)
18331833
}
18341834

18351835
#ifdef CONFIG_RFS_ACCEL
1836-
priv->dev->rx_cpu_rmap = alloc_irq_cpu_rmap(priv->mdev->dev->caps.comp_pool);
1837-
if (!priv->dev->rx_cpu_rmap)
1838-
goto err;
1836+
if (priv->mdev->dev->caps.comp_pool) {
1837+
priv->dev->rx_cpu_rmap = alloc_irq_cpu_rmap(priv->mdev->dev->caps.comp_pool);
1838+
if (!priv->dev->rx_cpu_rmap)
1839+
goto err;
1840+
}
18391841
#endif
18401842

18411843
return 0;

0 commit comments

Comments
 (0)