net/mlx5: Clean SRIOV eswitch resources upon VF creation failure
authorEran Ben Elisha <eranbe@mellanox.com>
Thu, 1 Jun 2017 06:40:56 +0000 (09:40 +0300)
committerSaeed Mahameed <saeedm@mellanox.com>
Thu, 27 Jul 2017 13:40:16 +0000 (16:40 +0300)
commit079adf05398f12371ea91dd53fdf61ee6352bc01
treed9e1064338e0fb512070ae3debe4fa118de626a9
parent6b84202c946cd3da3a8daa92c682510e9ed80321
net/mlx5: Clean SRIOV eswitch resources upon VF creation failure

Upon sriov enable, eswitch is always enabled.
Currently, if enable hca failed over all VFs, we would skip eswitch
disable as part of sriov disable, which will lead to resources leak.

Fix it by disabling eswitch if it was enabled (use indication from
eswitch mode).

Fixes: 6b6adee3dad2 ('net/mlx5: SRIOV core code refactoring')
Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Signed-off-by: Noa Osherovich <noaos@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
drivers/net/ethernet/mellanox/mlx5/core/sriov.c