]> asedeno.scripts.mit.edu Git - linux.git/commit
net/mlx5e: Avoid dealing with vport representors if not being e-switch manager
authorOr Gerlitz <ogerlitz@mellanox.com>
Thu, 31 May 2018 08:32:56 +0000 (11:32 +0300)
committerSaeed Mahameed <saeedm@mellanox.com>
Tue, 26 Jun 2018 22:26:30 +0000 (15:26 -0700)
commit733d3e5497070d05971352ca5087bac83c197c3d
tree871e15a0e6e8ad0c90e605ab16439602c43750fc
parent0efc8562491b7d36f6bbc4fbc8f3348cb6641e9c
net/mlx5e: Avoid dealing with vport representors if not being e-switch manager

In smartnic env, the host (PF) driver might not be an e-switch
manager, hence the switchdev mode representors are running on
the embedded cpu (EC) and not at the host.

As such, we should avoid dealing with vport representors if
not being esw manager.

While here, make sure to disallow eswitch switchdev related
setups through devlink if we are not esw managers.

Fixes: cb67b832921c ('net/mlx5e: Introduce SRIOV VF representors')
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Reviewed-by: Eli Cohen <eli@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c