diff options
author | Matan Barak <matanb@mellanox.com> | 2014-11-13 13:45:29 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-11-13 21:16:17 +0100 |
commit | ffc39f6d6fff2878c55ffa5ffb1828d7618c0a29 (patch) | |
tree | 6323cfe73ab51c008a4848fadd6eca128a50e7d8 /drivers/net/ethernet/mellanox/mlx4/main.c | |
parent | net/mlx4_core: Use correct variable type for mlx4_slave_cap (diff) | |
download | linux-ffc39f6d6fff2878c55ffa5ffb1828d7618c0a29.tar.xz linux-ffc39f6d6fff2878c55ffa5ffb1828d7618c0a29.zip |
net/mlx4_core: Refactor mlx4_cmd_init and mlx4_cmd_cleanup
Refactoring mlx4_cmd_init and mlx4_cmd_cleanup such that partial init
and cleanup are possible. After this refactoring, calling mlx4_cmd_init
several times is safe.
This is necessary in the VF init flow when mlx4_init_hca returns -EACCESS,
we need to issue cleanup and re-attempt to call it with the slave flag.
Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/main.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c index 71f1f3be4ebe..b2732eb82bf1 100644 --- a/drivers/net/ethernet/mellanox/mlx4/main.c +++ b/drivers/net/ethernet/mellanox/mlx4/main.c @@ -2396,7 +2396,7 @@ slave_start: if (err == -EACCES) { /* Not primary Physical function * Running in slave mode */ - mlx4_cmd_cleanup(dev); + mlx4_cmd_cleanup(dev, MLX4_CMD_CLEANUP_ALL); dev->flags |= MLX4_FLAG_SLAVE; dev->flags &= ~MLX4_FLAG_MASTER; goto slave_start; @@ -2561,7 +2561,7 @@ err_mfunc: mlx4_multi_func_cleanup(dev); err_cmd: - mlx4_cmd_cleanup(dev); + mlx4_cmd_cleanup(dev, MLX4_CMD_CLEANUP_ALL); err_sriov: if (dev->flags & MLX4_FLAG_SRIOV && !existing_vfs) @@ -2805,7 +2805,7 @@ static void mlx4_unload_one(struct pci_dev *pdev) mlx4_close_hca(dev); if (mlx4_is_slave(dev)) mlx4_multi_func_cleanup(dev); - mlx4_cmd_cleanup(dev); + mlx4_cmd_cleanup(dev, MLX4_CMD_CLEANUP_ALL); if (dev->flags & MLX4_FLAG_MSI_X) pci_disable_msix(pdev); |