Commit 0a5b5891 authored by Aviv Heller's avatar Aviv Heller Committed by Saeed Mahameed
Browse files

net/mlx5: Fix query_nic_sys_image_guid() error during init

vport system image guid should be queried using vport nic API for
Ethernet ports, and vport hca API for Infiniband ports.

Fixes: fadd59fc

 ("net/mlx5: Introduce inter-device communication mechanism")
Signed-off-by: default avatarAviv Heller <avivh@mellanox.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
parent e32ee6c7
......@@ -1204,9 +1204,19 @@ EXPORT_SYMBOL_GPL(mlx5_nic_vport_unaffiliate_multiport);
u64 mlx5_query_nic_system_image_guid(struct mlx5_core_dev *mdev)
{
if (!mdev->sys_image_guid)
mlx5_query_nic_vport_system_image_guid(mdev, &mdev->sys_image_guid);
int port_type_cap = MLX5_CAP_GEN(mdev, port_type);
u64 tmp = 0;
return mdev->sys_image_guid;
if (mdev->sys_image_guid)
return mdev->sys_image_guid;
if (port_type_cap == MLX5_CAP_PORT_TYPE_ETH)
mlx5_query_nic_vport_system_image_guid(mdev, &tmp);
else
mlx5_query_hca_vport_system_image_guid(mdev, &tmp);
mdev->sys_image_guid = tmp;
return tmp;
}
EXPORT_SYMBOL_GPL(mlx5_query_nic_system_image_guid);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment