diff options
author | Aviv Heller <avivh@mellanox.com> | 2016-04-17 19:32:13 +0300 |
---|---|---|
committer | Leon Romanovsky <leon@kernel.org> | 2016-08-18 18:49:56 +0300 |
commit | edb31b1686751f605eb02a6dcf5ef29c5d485a8e (patch) | |
tree | b81e797ee6f8c06b1aff45441ccb99314aef2f4f /drivers/net/ethernet/mellanox/mlx5/core/sriov.c | |
parent | db60b80273c5e0e61c2ad59d2903c9988b9d184c (diff) | |
download | linux-edb31b1686751f605eb02a6dcf5ef29c5d485a8e.tar.bz2 |
net/mlx5: LAG and SRIOV cannot be used together
Until support will be added for RoCE LAG SRIOV.
Signed-off-by: Aviv Heller <avivh@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/sriov.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/sriov.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/sriov.c b/drivers/net/ethernet/mellanox/mlx5/core/sriov.c index 0680dfb4bb1e..78e789245183 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/sriov.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/sriov.c @@ -37,6 +37,13 @@ #include "eswitch.h" #endif +bool mlx5_sriov_is_enabled(struct mlx5_core_dev *dev) +{ + struct mlx5_core_sriov *sriov = &dev->priv.sriov; + + return !!sriov->num_vfs; +} + static void enable_vfs(struct mlx5_core_dev *dev, int num_vfs) { struct mlx5_core_sriov *sriov = &dev->priv.sriov; @@ -144,6 +151,11 @@ int mlx5_core_sriov_configure(struct pci_dev *pdev, int num_vfs) if (!mlx5_core_is_pf(dev)) return -EPERM; + if (num_vfs && mlx5_lag_is_active(dev)) { + mlx5_core_warn(dev, "can't turn sriov on while LAG is active"); + return -EINVAL; + } + mlx5_core_cleanup_vfs(dev); if (!num_vfs) { |