Commit d81c7186 authored by Jack Morgenstein's avatar Jack Morgenstein Committed by David S. Miller

mlx4_core: adjust catas operation for SRIOV mode

When running in SRIOV mode, driver should not automatically start/stop
the mlx4_core upon sensing an HCA internal error -- doing this disables/enables
sriov, which will cause the hypervisor to hang if there are running VMs with
attached VFs.

In addition, on VMs the catas process should not run at all, since the HCA
error buffer is not available to VMs in the BARs.
Signed-off-by: default avatarJack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2b8fb286
...@@ -48,7 +48,8 @@ static struct work_struct catas_work; ...@@ -48,7 +48,8 @@ static struct work_struct catas_work;
static int internal_err_reset = 1; static int internal_err_reset = 1;
module_param(internal_err_reset, int, 0644); module_param(internal_err_reset, int, 0644);
MODULE_PARM_DESC(internal_err_reset, MODULE_PARM_DESC(internal_err_reset,
"Reset device on internal errors if non-zero (default 1)"); "Reset device on internal errors if non-zero"
" (default 1, in SRIOV mode default is 0)");
static void dump_err_buf(struct mlx4_dev *dev) static void dump_err_buf(struct mlx4_dev *dev)
{ {
...@@ -116,6 +117,10 @@ void mlx4_start_catas_poll(struct mlx4_dev *dev) ...@@ -116,6 +117,10 @@ void mlx4_start_catas_poll(struct mlx4_dev *dev)
struct mlx4_priv *priv = mlx4_priv(dev); struct mlx4_priv *priv = mlx4_priv(dev);
phys_addr_t addr; phys_addr_t addr;
/*If we are in SRIOV the default of the module param must be 0*/
if (mlx4_is_mfunc(dev))
internal_err_reset = 0;
INIT_LIST_HEAD(&priv->catas_err.list); INIT_LIST_HEAD(&priv->catas_err.list);
init_timer(&priv->catas_err.timer); init_timer(&priv->catas_err.timer);
priv->catas_err.map = NULL; priv->catas_err.map = NULL;
......
...@@ -142,7 +142,8 @@ int mlx4_register_device(struct mlx4_dev *dev) ...@@ -142,7 +142,8 @@ int mlx4_register_device(struct mlx4_dev *dev)
mlx4_add_device(intf, priv); mlx4_add_device(intf, priv);
mutex_unlock(&intf_mutex); mutex_unlock(&intf_mutex);
mlx4_start_catas_poll(dev); if (!mlx4_is_slave(dev))
mlx4_start_catas_poll(dev);
return 0; return 0;
} }
...@@ -152,7 +153,8 @@ void mlx4_unregister_device(struct mlx4_dev *dev) ...@@ -152,7 +153,8 @@ void mlx4_unregister_device(struct mlx4_dev *dev)
struct mlx4_priv *priv = mlx4_priv(dev); struct mlx4_priv *priv = mlx4_priv(dev);
struct mlx4_interface *intf; struct mlx4_interface *intf;
mlx4_stop_catas_poll(dev); if (!mlx4_is_slave(dev))
mlx4_stop_catas_poll(dev);
mutex_lock(&intf_mutex); mutex_lock(&intf_mutex);
list_for_each_entry(intf, &intf_list, list) list_for_each_entry(intf, &intf_list, list)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment