]> git.itanic.dy.fi Git - linux-stable/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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 22 Jul 2018 12:28:44 +0000 (14:28 +0200)
commit1d8dda4444fa0e8799a40d74e3502aac841ea002
treee4c1b87e50563a8fa0fcc6597c4d2a8c93509ada
parentf389c17b8dc54b474d33728e5882dcc276a467fa
net/mlx5e: Avoid dealing with vport representors if not being e-switch manager

[ Upstream commit 733d3e5497070d05971352ca5087bac83c197c3d ]

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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