aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mlx5/main.c
diff options
context:
space:
mode:
authorHaggai Eran <haggaie@mellanox.com>2014-12-11 10:04:20 -0500
committerRoland Dreier <roland@purestorage.com>2014-12-15 21:19:02 -0500
commit8cdd312cfed706b067d7ea952603e28cc33c40cc (patch)
treec9372550bc0430d23f87862451a405038dbf0d93 /drivers/infiniband/hw/mlx5/main.c
parente420f0c0f3d1022789fcb59b2a0c4b979ce311ba (diff)
IB/mlx5: Implement the ODP capability query verb
The patch adds infrastructure to query ODP capabilities in the mlx5 driver. The code will read the capabilities from the device, and enable only those capabilities that both the driver and the device supports. At this point ODP is not supported, so no capability is copied from the device, but the patch exposes the global ODP device capability bit. Signed-off-by: Shachar Raindel <raindel@mellanox.com> Signed-off-by: Haggai Eran <haggaie@mellanox.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx5/main.c')
-rw-r--r--drivers/infiniband/hw/mlx5/main.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index 1ba6c42e4df8..e6d775f2446d 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -244,6 +244,12 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
244 props->max_mcast_grp; 244 props->max_mcast_grp;
245 props->max_map_per_fmr = INT_MAX; /* no limit in ConnectIB */ 245 props->max_map_per_fmr = INT_MAX; /* no limit in ConnectIB */
246 246
247#ifdef CONFIG_INFINIBAND_ON_DEMAND_PAGING
248 if (dev->mdev->caps.gen.flags & MLX5_DEV_CAP_FLAG_ON_DMND_PG)
249 props->device_cap_flags |= IB_DEVICE_ON_DEMAND_PAGING;
250 props->odp_caps = dev->odp_caps;
251#endif
252
247out: 253out:
248 kfree(in_mad); 254 kfree(in_mad);
249 kfree(out_mad); 255 kfree(out_mad);
@@ -1321,6 +1327,8 @@ static void *mlx5_ib_add(struct mlx5_core_dev *mdev)
1321 (1ull << IB_USER_VERBS_CMD_DESTROY_SRQ) | 1327 (1ull << IB_USER_VERBS_CMD_DESTROY_SRQ) |
1322 (1ull << IB_USER_VERBS_CMD_CREATE_XSRQ) | 1328 (1ull << IB_USER_VERBS_CMD_CREATE_XSRQ) |
1323 (1ull << IB_USER_VERBS_CMD_OPEN_QP); 1329 (1ull << IB_USER_VERBS_CMD_OPEN_QP);
1330 dev->ib_dev.uverbs_ex_cmd_mask =
1331 (1ull << IB_USER_VERBS_EX_CMD_QUERY_DEVICE);
1324 1332
1325 dev->ib_dev.query_device = mlx5_ib_query_device; 1333 dev->ib_dev.query_device = mlx5_ib_query_device;
1326 dev->ib_dev.query_port = mlx5_ib_query_port; 1334 dev->ib_dev.query_port = mlx5_ib_query_port;
@@ -1366,6 +1374,8 @@ static void *mlx5_ib_add(struct mlx5_core_dev *mdev)
1366 dev->ib_dev.free_fast_reg_page_list = mlx5_ib_free_fast_reg_page_list; 1374 dev->ib_dev.free_fast_reg_page_list = mlx5_ib_free_fast_reg_page_list;
1367 dev->ib_dev.check_mr_status = mlx5_ib_check_mr_status; 1375 dev->ib_dev.check_mr_status = mlx5_ib_check_mr_status;
1368 1376
1377 mlx5_ib_internal_query_odp_caps(dev);
1378
1369 if (mdev->caps.gen.flags & MLX5_DEV_CAP_FLAG_XRC) { 1379 if (mdev->caps.gen.flags & MLX5_DEV_CAP_FLAG_XRC) {
1370 dev->ib_dev.alloc_xrcd = mlx5_ib_alloc_xrcd; 1380 dev->ib_dev.alloc_xrcd = mlx5_ib_alloc_xrcd;
1371 dev->ib_dev.dealloc_xrcd = mlx5_ib_dealloc_xrcd; 1381 dev->ib_dev.dealloc_xrcd = mlx5_ib_dealloc_xrcd;