diff options
| author | Mark Bloch <mbloch@nvidia.com> | 2025-06-17 11:44:02 +0300 |
|---|---|---|
| committer | Leon Romanovsky <leon@kernel.org> | 2025-06-26 15:10:07 +0300 |
| commit | 611d08207d313500d010d8792424346ce70d0cfb (patch) | |
| tree | ddc0c2571601070f0815d246b2ab1da40925180a /include/linux | |
| parent | 8cffca866ba86cbf0d097e56521b17d830956d4a (diff) | |
| download | linux-611d08207d313500d010d8792424346ce70d0cfb.tar.xz | |
RDMA/mlx5: Allocate IB device with net namespace supplied from core dev
Use the new ib_alloc_device_with_net() API to allocate the IB device
so that it is properly bound to the network namespace obtained via
mlx5_core_net(). This change ensures correct namespace association
(e.g., for containerized setups).
Additionally, expose mlx5_core_net so that RDMA driver can use it.
Signed-off-by: Shay Drory <shayd@nvidia.com>
Signed-off-by: Mark Bloch <mbloch@nvidia.com>
Reviewed-by: Parav Pandit <parav@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/mlx5/driver.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h index e6ba8f4f4bd1..3475d33c75f4 100644 --- a/include/linux/mlx5/driver.h +++ b/include/linux/mlx5/driver.h @@ -1349,4 +1349,9 @@ enum { }; bool mlx5_wc_support_get(struct mlx5_core_dev *mdev); + +static inline struct net *mlx5_core_net(struct mlx5_core_dev *dev) +{ + return devlink_net(priv_to_devlink(dev)); +} #endif /* MLX5_DRIVER_H */ |
