net/mlx5: E-Switch, Reload IB interface when switching devlink modes
authorMark Bloch <markb@mellanox.com>
Tue, 23 Jan 2018 11:24:13 +0000 (11:24 +0000)
committerSaeed Mahameed <saeedm@mellanox.com>
Fri, 23 Feb 2018 20:36:39 +0000 (12:36 -0800)
commitc5447c70594b6a8e1e62a9dd9373813cb38f1c69
tree54ddc5661098fc02d327acb484a8afd7a092bd89
parentb5ca15ad7e6189f39dff73d786e41d2a507f7b8b
net/mlx5: E-Switch, Reload IB interface when switching devlink modes

Up until this point it wasn't possible to activate IB representors
when switching to switchdev mode, remove this limitation.

We trigger reload of the PF IB interface in order to make sure that
already allocated resources are invalid and new resources will be opened
correctly with all the limitations of switchdev mode applied (only raw
packet capabilities, without RoCE). We also move the remove/add to a
place where the E-Switch mode is set/unset to better control when to
trigger this action, this will allow the IB side to start in the correct
mode.

For better code reuse, create a function which reloads an interface and
export it.

Signed-off-by: Mark Bloch <markb@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/dev.c
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h