diff options
| author | Patrisious Haddad <[email protected]> | 2024-12-03 15:45:37 +0200 |
|---|---|---|
| committer | Leon Romanovsky <[email protected]> | 2024-12-05 03:35:11 -0500 |
| commit | e05feab22fd7dabcd6d272c4e2401ec1acdfdb9b (patch) | |
| tree | ac6656805425deb959723b9ea47a034e04eedc75 /include/linux | |
| parent | d0257e089d1bbd35c69b6c97ff73e3690ab149a9 (diff) | |
RDMA/mlx5: Enforce same type port association for multiport RoCE
Different core device types such as PFs and VFs shouldn't be affiliated
together since they have different capabilities, fix that by enforcing
type check before doing the affiliation.
Fixes: 32f69e4be269 ("{net, IB}/mlx5: Manage port association for multiport RoCE")
Reviewed-by: Mark Bloch <[email protected]>
Signed-off-by: Patrisious Haddad <[email protected]>
Link: https://patch.msgid.link/88699500f690dff1c1852c1ddb71f8a1cc8b956e.1733233480.git.leonro@nvidia.com
Reviewed-by: Mateusz Polchlopek <[email protected]>
Signed-off-by: Leon Romanovsky <[email protected]>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/mlx5/driver.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h index fc7e6153b73d..4f9e6f6dbaab 100644 --- a/include/linux/mlx5/driver.h +++ b/include/linux/mlx5/driver.h @@ -1202,6 +1202,12 @@ static inline bool mlx5_core_is_vf(const struct mlx5_core_dev *dev) return dev->coredev_type == MLX5_COREDEV_VF; } +static inline bool mlx5_core_same_coredev_type(const struct mlx5_core_dev *dev1, + const struct mlx5_core_dev *dev2) +{ + return dev1->coredev_type == dev2->coredev_type; +} + static inline bool mlx5_core_is_ecpf(const struct mlx5_core_dev *dev) { return dev->caps.embedded_cpu; |