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: Fix multiport device check over light SFs

Driver is using num_vhca_ports capability to distinguish between
multiport master device and multiport slave device. num_vhca_ports is a
capability the driver sets according to the MAX num_vhca_ports
capability reported by FW. On the other hand, light SFs doesn't set the
above capbility.

This leads to wrong results whenever light SFs is checking whether he is
a multiport master or slave.

Therefore, use the MAX capability to distinguish between master and
slave devices.

Fixes: e71383fb9cd1 ("net/mlx5: Light probe local SFs")
Signed-off-by: Shay Drory <shayd@nvidia.com>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Jacob Keller <Jacob.e.keller@intel.com>
Link: https://patch.msgid.link/20260218072904.1764634-2-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Shay Drory and committed by
Jakub Kicinski
47bf2e81 e6834a4c

+2 -2
+2 -2
include/linux/mlx5/driver.h
··· 1282 1282 static inline int mlx5_core_is_mp_slave(struct mlx5_core_dev *dev) 1283 1283 { 1284 1284 return MLX5_CAP_GEN(dev, affiliate_nic_vport_criteria) && 1285 - MLX5_CAP_GEN(dev, num_vhca_ports) <= 1; 1285 + MLX5_CAP_GEN_MAX(dev, num_vhca_ports) <= 1; 1286 1286 } 1287 1287 1288 1288 static inline int mlx5_core_is_mp_master(struct mlx5_core_dev *dev) 1289 1289 { 1290 - return MLX5_CAP_GEN(dev, num_vhca_ports) > 1; 1290 + return MLX5_CAP_GEN_MAX(dev, num_vhca_ports) > 1; 1291 1291 } 1292 1292 1293 1293 static inline int mlx5_core_mp_enabled(struct mlx5_core_dev *dev)