Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net/mlx5: Not returning mlx5_link_info table when speed is unknown

Because mlx5e_link_info and mlx5e_ext_link_info have holes
e.g. Azure mlx5 reports PTYS 19. Do not return it unless speed
is retrieved successfully.

Fixes: 65a5d35571849 ("net/mlx5: Refactor link speed handling with mlx5_link_info struct")
Suggested-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Li Tian <litian@redhat.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20250910003732.5973-1-litian@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Li Tian and committed by
Jakub Kicinski
5577352b 247981ee

+5 -1
+5 -1
drivers/net/ethernet/mellanox/mlx5/core/port.c
··· 1170 1170 mlx5e_port_get_link_mode_info_arr(mdev, &table, &max_size, 1171 1171 force_legacy); 1172 1172 i = find_first_bit(&temp, max_size); 1173 - if (i < max_size) 1173 + 1174 + /* mlx5e_link_info has holes. Check speed 1175 + * is not zero as indication of one. 1176 + */ 1177 + if (i < max_size && table[i].speed) 1174 1178 return &table[i]; 1175 1179 1176 1180 return NULL;