net/mlx5: Undo LAG upon request to create virtual functions
authorMoni Shoua <monis@mellanox.com>
Tue, 9 May 2017 09:20:55 +0000 (12:20 +0300)
committerSaeed Mahameed <saeedm@mellanox.com>
Thu, 15 Jun 2017 21:12:41 +0000 (00:12 +0300)
commit552db7bca568a8efbd0883f0597fbc42333cf094
tree7a0ecc483e62b333276b79abcde8010b6dbe6ec3
parent2fe30e23cddaf16fa3ffd188341cdf35d75f0f1b
net/mlx5: Undo LAG upon request to create virtual functions

LAG cannot work if virtual functions are present. Therefore, if LAG is
configured, the attempt to create virtual functions will fail. This gives
precedence to LAG over SRIOV which is not the desired behavior as users
might want to use the bonding/teaming driver also want to work with SRIOV.
In that case we don't want to force an order of actions, first create
virtual functions and only than configure a bonding/teaming net device.
To fix, if LAG is configured during a request to create virtual
functions, remove it and continue.

We ignore ENODEV when trying to forbid lag. This makes sense
because "No such device" means that lag is forbidden anyway.

Signed-off-by: Moni Shoua <monis@mellanox.com>
Reviewed-by: Aviv Heller <avivh@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/lag.c
drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h
drivers/net/ethernet/mellanox/mlx5/core/sriov.c