aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSagi Grimberg <sagig@mellanox.com>2015-09-24 03:34:23 -0400
committerDoug Ledford <dledford@redhat.com>2015-09-25 10:46:51 -0400
commitc6790aa9f4fdc26b1246ba36da2fd749663beb65 (patch)
tree0584c4826d9ab18d3d54d74842e043a8e1a54524
parent3cffd930171518821595839c5ce7036894ef0d74 (diff)
IB/mlx5: Remove support for IB_DEVICE_LOCAL_DMA_LKEY
Commit 96249d70dd70 ("IB/core: Guarantee that a local_dma_lkey is available") allows ULPs that make use of the local dma key to keep working as before by allocating a DMA MR with local permissions and converted these consumers to use the MR associated with the PD rather then device->local_dma_lkey. ConnectIB has some known issues with memory registration using the local_dma_lkey (SEND, RDMA, RECV seems to work ok). Thus don't expose support for it (remove device->local_dma_lkey setting), and take advantage of the above commit such that no regression is introduced to working systems. The local_dma_lkey support will be restored in CX4 depending on FW capability query. Signed-off-by: Sagi Grimberg <sagig@mellanox.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r--drivers/infiniband/hw/mlx5/main.c10
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/fw.c22
-rw-r--r--include/linux/mlx5/device.h11
-rw-r--r--include/linux/mlx5/driver.h1
4 files changed, 1 insertions, 43 deletions
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index 41d6911e244e..0ab9625911a1 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -245,7 +245,6 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
245 props->device_cap_flags |= IB_DEVICE_BAD_QKEY_CNTR; 245 props->device_cap_flags |= IB_DEVICE_BAD_QKEY_CNTR;
246 if (MLX5_CAP_GEN(mdev, apm)) 246 if (MLX5_CAP_GEN(mdev, apm))
247 props->device_cap_flags |= IB_DEVICE_AUTO_PATH_MIG; 247 props->device_cap_flags |= IB_DEVICE_AUTO_PATH_MIG;
248 props->device_cap_flags |= IB_DEVICE_LOCAL_DMA_LKEY;
249 if (MLX5_CAP_GEN(mdev, xrc)) 248 if (MLX5_CAP_GEN(mdev, xrc))
250 props->device_cap_flags |= IB_DEVICE_XRC; 249 props->device_cap_flags |= IB_DEVICE_XRC;
251 props->device_cap_flags |= IB_DEVICE_MEM_MGT_EXTENSIONS; 250 props->device_cap_flags |= IB_DEVICE_MEM_MGT_EXTENSIONS;
@@ -1245,18 +1244,10 @@ static int create_dev_resources(struct mlx5_ib_resources *devr)
1245 struct ib_srq_init_attr attr; 1244 struct ib_srq_init_attr attr;
1246 struct mlx5_ib_dev *dev; 1245 struct mlx5_ib_dev *dev;
1247 struct ib_cq_init_attr cq_attr = {.cqe = 1}; 1246 struct ib_cq_init_attr cq_attr = {.cqe = 1};
1248 u32 rsvd_lkey;
1249 int ret = 0; 1247 int ret = 0;
1250 1248
1251 dev = container_of(devr, struct mlx5_ib_dev, devr); 1249 dev = container_of(devr, struct mlx5_ib_dev, devr);
1252 1250
1253 ret = mlx5_core_query_special_context(dev->mdev, &rsvd_lkey);
1254 if (ret) {
1255 pr_err("Failed to query special context %d\n", ret);
1256 return ret;
1257 }
1258 dev->ib_dev.local_dma_lkey = rsvd_lkey;
1259
1260 devr->p0 = mlx5_ib_alloc_pd(&dev->ib_dev, NULL, NULL); 1251 devr->p0 = mlx5_ib_alloc_pd(&dev->ib_dev, NULL, NULL);
1261 if (IS_ERR(devr->p0)) { 1252 if (IS_ERR(devr->p0)) {
1262 ret = PTR_ERR(devr->p0); 1253 ret = PTR_ERR(devr->p0);
@@ -1418,6 +1409,7 @@ static void *mlx5_ib_add(struct mlx5_core_dev *mdev)
1418 strlcpy(dev->ib_dev.name, "mlx5_%d", IB_DEVICE_NAME_MAX); 1409 strlcpy(dev->ib_dev.name, "mlx5_%d", IB_DEVICE_NAME_MAX);
1419 dev->ib_dev.owner = THIS_MODULE; 1410 dev->ib_dev.owner = THIS_MODULE;
1420 dev->ib_dev.node_type = RDMA_NODE_IB_CA; 1411 dev->ib_dev.node_type = RDMA_NODE_IB_CA;
1412 dev->ib_dev.local_dma_lkey = 0 /* not supported for now */;
1421 dev->num_ports = MLX5_CAP_GEN(mdev, num_ports); 1413 dev->num_ports = MLX5_CAP_GEN(mdev, num_ports);
1422 dev->ib_dev.phys_port_cnt = dev->num_ports; 1414 dev->ib_dev.phys_port_cnt = dev->num_ports;
1423 dev->ib_dev.num_comp_vectors = 1415 dev->ib_dev.num_comp_vectors =
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fw.c b/drivers/net/ethernet/mellanox/mlx5/core/fw.c
index aa0d5ffe92d8..9335e5ae18cc 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/fw.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/fw.c
@@ -200,25 +200,3 @@ int mlx5_cmd_teardown_hca(struct mlx5_core_dev *dev)
200 200
201 return err; 201 return err;
202} 202}
203
204int mlx5_core_query_special_context(struct mlx5_core_dev *dev, u32 *rsvd_lkey)
205{
206 struct mlx5_cmd_query_special_contexts_mbox_in in;
207 struct mlx5_cmd_query_special_contexts_mbox_out out;
208 int err;
209
210 memset(&in, 0, sizeof(in));
211 memset(&out, 0, sizeof(out));
212 in.hdr.opcode = cpu_to_be16(MLX5_CMD_OP_QUERY_SPECIAL_CONTEXTS);
213 err = mlx5_cmd_exec(dev, &in, sizeof(in), &out, sizeof(out));
214 if (err)
215 return err;
216
217 if (out.hdr.status)
218 err = mlx5_cmd_status_to_err(&out.hdr);
219
220 *rsvd_lkey = be32_to_cpu(out.resd_lkey);
221
222 return err;
223}
224EXPORT_SYMBOL(mlx5_core_query_special_context);
diff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h
index 8eb3b19af2a4..250b1ff8b48d 100644
--- a/include/linux/mlx5/device.h
+++ b/include/linux/mlx5/device.h
@@ -402,17 +402,6 @@ struct mlx5_cmd_teardown_hca_mbox_out {
402 u8 rsvd[8]; 402 u8 rsvd[8];
403}; 403};
404 404
405struct mlx5_cmd_query_special_contexts_mbox_in {
406 struct mlx5_inbox_hdr hdr;
407 u8 rsvd[8];
408};
409
410struct mlx5_cmd_query_special_contexts_mbox_out {
411 struct mlx5_outbox_hdr hdr;
412 __be32 dump_fill_mkey;
413 __be32 resd_lkey;
414};
415
416struct mlx5_cmd_layout { 405struct mlx5_cmd_layout {
417 u8 type; 406 u8 type;
418 u8 rsvd0[3]; 407 u8 rsvd0[3];
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
index 27b53f9a24ad..8b6d6f2154a4 100644
--- a/include/linux/mlx5/driver.h
+++ b/include/linux/mlx5/driver.h
@@ -845,7 +845,6 @@ void *mlx5_get_protocol_dev(struct mlx5_core_dev *mdev, int protocol);
845int mlx5_register_interface(struct mlx5_interface *intf); 845int mlx5_register_interface(struct mlx5_interface *intf);
846void mlx5_unregister_interface(struct mlx5_interface *intf); 846void mlx5_unregister_interface(struct mlx5_interface *intf);
847int mlx5_core_query_vendor_id(struct mlx5_core_dev *mdev, u32 *vendor_id); 847int mlx5_core_query_vendor_id(struct mlx5_core_dev *mdev, u32 *vendor_id);
848int mlx5_core_query_special_context(struct mlx5_core_dev *dev, u32 *rsvd_lkey);
849 848
850struct mlx5_profile { 849struct mlx5_profile {
851 u64 mask; 850 u64 mask;