net/mlx5: E-Switch, Reg/unreg function changed event at correct stage
authorBodong Wang <bodong@mellanox.com>
Fri, 28 Jun 2019 22:36:18 +0000 (22:36 +0000)
committerSaeed Mahameed <saeedm@mellanox.com>
Mon, 1 Jul 2019 23:40:31 +0000 (16:40 -0700)
commit16fff98a7e827396eb68f9243636b7240f511f10
treeb3a3fed3df1063e8ac1f89437570b6184dcd330b
parent062f4bf4aab5c6bb62bea59cda59d5c64f23ba29
net/mlx5: E-Switch, Reg/unreg function changed event at correct stage

When driver is doing eswitch mode change, it's critical to keep number
of enabled VFs unchanged. However, it can be changed on the fly once
function changed event is registered.

To remove this uncertainty, function changed event should not be
registered before all setups, and first be unregistered before all
cleanups. Wrap this functionality together with vport event handler.

Fixes: 61fc880839e6 ("net/mlx5: E-Switch, Handle representors creation in handler context")
Signed-off-by: Bodong Wang <bodong@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c