net/mlx5: E-Switch, Avoid setup attempt if not being e-switch manager
authorOr Gerlitz <ogerlitz@mellanox.com>
Thu, 31 May 2018 08:16:18 +0000 (11:16 +0300)
committerSaeed Mahameed <saeedm@mellanox.com>
Tue, 26 Jun 2018 22:26:29 +0000 (15:26 -0700)
commit0efc8562491b7d36f6bbc4fbc8f3348cb6641e9c
treea90ddb33dfba78270d7292955185b3eb2bfc08f1
parent8ffd569aaa818f2624ca821d9a246342fa8b8c50
net/mlx5: E-Switch, Avoid setup attempt if not being e-switch manager

In smartnic env, the host (PF) driver might not be an e-switch
manager, hence the FW will err on driver attempts to deal with
setting/unsetting the eswitch and as a result the overall setup
of sriov will fail.

Fix that by avoiding the operation if e-switch management is not
allowed for this driver instance. While here, move to use the
correct name for the esw manager capability name.

Fixes: 81848731ff40 ('net/mlx5: E-Switch, Add SR-IOV (FDB) support')
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Reported-by: Guy Kushnir <guyk@mellanox.com>
Reviewed-by: Eli Cohen <eli@melloanox.com>
Tested-by: Eli Cohen <eli@melloanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
drivers/net/ethernet/mellanox/mlx5/core/fw.c
drivers/net/ethernet/mellanox/mlx5/core/sriov.c
include/linux/mlx5/eswitch.h
include/linux/mlx5/mlx5_ifc.h