]> git.baikalelectronics.ru Git - kernel.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)
commit66f420457d61d8cf3458ed84f8e1a432f42522ff
tree871e15a0e6e8ad0c90e605ab16439602c43750fc
parent7dc0f841847c7e753cc6d65f510d9bc1ef5975ba
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: e0a4e2a61370 ('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