summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorDragos Tatulea <dtatulea@nvidia.com>2026-09-30 14:42:19 +0300
committerLeon Romanovsky <leon@kernel.org>2026-10-01 11:40:42 -0400
commit2365f8d7f609cff766b150028372bc28d8b436f7 (patch)
treec66f4a75265d81943137d5ced27779c10270b21e /include/linux
parenta727a424068b5d54fe80ad1cfbf2fa6be2f39e61 (diff)
RDMA/mlx5: Add mlx5_data_direct_supported() helper
The data direct capability FW checks are duplicated inline in mlx5_ib_data_direct_init() and mlx5_ib_data_direct_cleanup(). Wrap it in a mlx5_data_direct_supported() helper and use it in both places, in preparation for moving the data direct matching code to mlx5_core. For the same reason put it in driver.h instead of data_direct.h. No functional change. Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com> Reviewed-by: Leon Romanovsky <leonro@nvidia.com> Reviewed-by: Cosmin Ratiu <cratiu@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Link: https://patch.msgid.link/20260930114227.139274-3-tariqt@nvidia.com Signed-off-by: Leon Romanovsky <leon@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mlx5/driver.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
index b1871c0821d0..ee29f95ead18 100644
--- a/include/linux/mlx5/driver.h
+++ b/include/linux/mlx5/driver.h
@@ -1395,4 +1395,10 @@ static inline struct net *mlx5_core_net(struct mlx5_core_dev *dev)
#define MLX5_SW_IMAGE_GUID_MAX_BYTES 9
+static inline bool mlx5_data_direct_supported(struct mlx5_core_dev *mdev)
+{
+ return MLX5_CAP_GEN(mdev, data_direct) &&
+ MLX5_CAP_GEN_2(mdev, query_vuid);
+}
+
#endif /* MLX5_DRIVER_H */