diff options
author | Yishai Hadas <yishaih@nvidia.com> | 2022-06-02 12:47:34 +0300 |
---|---|---|
committer | Saeed Mahameed <saeedm@nvidia.com> | 2022-07-14 01:56:45 +0300 |
commit | dc402ccc0d7b55922a79505df3000da7deb77a2b (patch) | |
tree | 44953544744df1b29390053b9b9455d4ac6a050a /drivers/net/ethernet/mellanox/mlx5/core/fw.c | |
parent | 0372c546eca575445331c0ad8902210b70be6d61 (diff) | |
download | linux-dc402ccc0d7b55922a79505df3000da7deb77a2b.tar.xz |
net/mlx5: Use software VHCA id when it's supported
Use software VHCA id when it's supported by the firmware.
A unique id is allocated upon mlx5_mdev_init() and freed upon
mlx5_mdev_uninit(), as such it stays the same during the full life cycle
of the device including upon health recovery if occurred.
The conjunction of sw_vhca_id with sw_owner_id will be a global unique
id per function which uses mlx5_core.
The sw_vhca_id is set upon init_hca command and is used to specify the
VHCA that the NIC vport is affiliated with.
This functionality is needed upon migration of VM which is MPV based.
(i.e. multi port device).
Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/fw.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/fw.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fw.c b/drivers/net/ethernet/mellanox/mlx5/core/fw.c index cfb8bedba512..079fa44ada71 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fw.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fw.c @@ -289,6 +289,10 @@ int mlx5_cmd_init_hca(struct mlx5_core_dev *dev, uint32_t *sw_owner_id) sw_owner_id[i]); } + if (MLX5_CAP_GEN_2_MAX(dev, sw_vhca_id_valid) && + dev->priv.sw_vhca_id > 0) + MLX5_SET(init_hca_in, in, sw_vhca_id, dev->priv.sw_vhca_id); + return mlx5_cmd_exec_in(dev, init_hca, in); } |