summaryrefslogtreecommitdiffstats
path: root/include/linux/mlx5/device.h
diff options
context:
space:
mode:
authorAriel Levkovich2018-04-05 17:53:26 +0200
committerJason Gunthorpe2018-04-05 21:04:48 +0200
commite72bd817aee2bd867a90aac68aca07d99addcb55 (patch)
tree2507417360321af20b5b2357117011022d368310 /include/linux/mlx5/device.h
parentIB/uverbs: Add device memory registration ioctl support (diff)
downloadkernel-qcow2-linux-e72bd817aee2bd867a90aac68aca07d99addcb55.tar.gz
kernel-qcow2-linux-e72bd817aee2bd867a90aac68aca07d99addcb55.tar.xz
kernel-qcow2-linux-e72bd817aee2bd867a90aac68aca07d99addcb55.zip
net/mlx5: Query device memory capabilities
This patch adds querying of device memory capabilities by the mlx5_core driver during initialization. Device memory capabilities is a new capability type and structure which contains the necessary data that is needed for future device memory allocation. The presence of this new capabilities struct is indicated in the general capabilities struct which is queried first by the driver. If the presence bit is set, the driver will also query the new capabilities struct and save it in the device context. Signed-off-by: Ariel Levkovich <lariel@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'include/linux/mlx5/device.h')
-rw-r--r--include/linux/mlx5/device.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h
index 413df3c11a46..2651691c05fb 100644
--- a/include/linux/mlx5/device.h
+++ b/include/linux/mlx5/device.h
@@ -1013,6 +1013,9 @@ enum mlx5_cap_type {
MLX5_CAP_RESERVED,
MLX5_CAP_VECTOR_CALC,
MLX5_CAP_QOS,
+ MLX5_CAP_DEBUG,
+ MLX5_CAP_RESERVED_14,
+ MLX5_CAP_DEV_MEM,
/* NUM OF CAP Types */
MLX5_CAP_NUM
};
@@ -1161,6 +1164,12 @@ enum mlx5_qcam_feature_groups {
#define MLX5_CAP64_FPGA(mdev, cap) \
MLX5_GET64(fpga_cap, (mdev)->caps.fpga, cap)
+#define MLX5_CAP_DEV_MEM(mdev, cap)\
+ MLX5_GET(device_mem_cap, mdev->caps.hca_cur[MLX5_CAP_DEV_MEM], cap)
+
+#define MLX5_CAP64_DEV_MEM(mdev, cap)\
+ MLX5_GET64(device_mem_cap, mdev->caps.hca_cur[MLX5_CAP_DEV_MEM], cap)
+
enum {
MLX5_CMD_STAT_OK = 0x0,
MLX5_CMD_STAT_INT_ERR = 0x1,