diff options
| author | Shay Drory <shayd@nvidia.com> | 2026-09-23 13:38:26 +0300 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-09-28 17:17:14 -0700 |
| commit | d451adde0203fa62519eb224be87046b27c76b99 (patch) | |
| tree | d9ad1b24b0cc30319d977ba457477166e3b1317b /include/linux | |
| parent | 9d608a40c2d400ef7529e13c165278053ea0d51c (diff) | |
| download | linux-d451adde0203fa62519eb224be87046b27c76b99.tar.gz linux-d451adde0203fa62519eb224be87046b27c76b99.zip | |
net/mlx5: E-switch, derive manager vport from device capability
mlx5_eswitch_manager_vport() hardcoded the e-switch manager vport as
either the ECPF or the host PF. Read esw_manager_vport_number from the
e-switch capability when esw_manager_vport_number_valid is set, so the
manager vport can be a VF - a prerequisite for VFs acting as e-switch
managers. Keep the previous mapping as fallback when the capability does
not report a number.
Signed-off-by: Shay Drory <shayd@nvidia.com>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Reviewed-by: Akiva Goldberger <agoldberger@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20260923103830.1183-10-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/mlx5/eswitch.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/mlx5/eswitch.h b/include/linux/mlx5/eswitch.h index a0dd162baa78..03d3620141c8 100644 --- a/include/linux/mlx5/eswitch.h +++ b/include/linux/mlx5/eswitch.h @@ -222,6 +222,9 @@ static inline bool is_mdev_switchdev_mode(struct mlx5_core_dev *dev) /* The returned number is valid only when the dev is eswitch manager. */ static inline u16 mlx5_eswitch_manager_vport(struct mlx5_core_dev *dev) { + if (MLX5_CAP_ESW(dev, esw_manager_vport_number_valid)) + return MLX5_CAP_ESW(dev, esw_manager_vport_number); + return mlx5_core_is_ecpf_esw_manager(dev) ? MLX5_VPORT_ECPF : MLX5_VPORT_HOST_PF; } |
