net/mlx5: E-switch, Extend eswitch enable to handle num_vfs change
authorParav Pandit <parav@mellanox.com>
Wed, 18 Dec 2019 10:58:58 +0000 (04:58 -0600)
committerSaeed Mahameed <saeedm@mellanox.com>
Thu, 26 Mar 2020 06:19:23 +0000 (23:19 -0700)
commitebf77bb83f635377ad7946b73490b18ecf50dc29
tree770f9ae2f0a7cae9369bb0fbd5852d983a0f2abe
parentae24432cbc2b2d7f5a8d636194422604b0b4c4f7
net/mlx5: E-switch, Extend eswitch enable to handle num_vfs change

Subsequent patch protects eswitch mode changes across sriov and devlink
interfaces. It is desirable for eswitch to provide thread safe eswitch
enable and disable APIs.
Hence, extend eswitch enable API to optionally update num_vfs when
requested.

In subsequent patch, eswitch num_vfs are updated after all the eswitch
users eswitch drops its reference count.

Reviewed-by: Roi Dayan <roid@mellanox.com>
Reviewed-by: Bodong Wang <bodong@mellanox.com>
Reviewed-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Parav Pandit <parav@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
drivers/net/ethernet/mellanox/mlx5/core/sriov.c