diff options
author | Rabie Loulou | 2018-06-06 15:31:34 +0200 |
---|---|---|
committer | Saeed Mahameed | 2018-12-14 22:28:54 +0100 |
commit | eff849b2c669ebf0df88762f082bcb252f8e883c (patch) | |
tree | b2eeb4dc8942937041d1ecf6c9cd526f5c659f81 /drivers/net/ethernet/mellanox/mlx5/core/sriov.c | |
parent | net/mlx5: Adjustments for the activate LAG logic to run under sriov (diff) | |
download | kernel-qcow2-linux-eff849b2c669ebf0df88762f082bcb252f8e883c.tar.gz kernel-qcow2-linux-eff849b2c669ebf0df88762f082bcb252f8e883c.tar.xz kernel-qcow2-linux-eff849b2c669ebf0df88762f082bcb252f8e883c.zip |
net/mlx5: Allow/disallow LAG according to pre-req only
Remove the lag forbid/allow functions, change the lag prereq check to
run in the do-bond logic, so every change in the prereq state will
cause LAG to be disabled/enabled accordingly after the next do-bond run.
Add lag update function, so every component which changes the prereq
state and want the LAG to re-calc the conditions can call the update
function.
Signed-off-by: Rabie Loulou <rabiel@mellanox.com>
Signed-off-by: Aviv Heller <avivh@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/sriov.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/sriov.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/sriov.c b/drivers/net/ethernet/mellanox/mlx5/core/sriov.c index a0674962f02c..6e178030d8fb 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/sriov.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/sriov.c @@ -216,20 +216,10 @@ int mlx5_core_sriov_configure(struct pci_dev *pdev, int num_vfs) if (!mlx5_core_is_pf(dev)) return -EPERM; - if (num_vfs) { - int ret; - - ret = mlx5_lag_forbid(dev); - if (ret && (ret != -ENODEV)) - return ret; - } - - if (num_vfs) { + if (num_vfs) err = mlx5_sriov_enable(pdev, num_vfs); - } else { + else mlx5_sriov_disable(pdev); - mlx5_lag_allow(dev); - } return err ? err : num_vfs; } |