diff options
author | Sagi Grimberg <sagig@mellanox.com> | 2015-07-20 19:54:36 +0300 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2015-08-28 22:54:46 -0400 |
commit | a3c874200cbcd95ed914ba84f33f571a0ef7adfa (patch) | |
tree | 07ed51041215501b61f6f0d7672bafcbfa6e4062 /drivers/infiniband/hw | |
parent | c13dcf9f2d6f5f06ef1bf79ec456df614c5e058b (diff) | |
download | linux-stable-a3c874200cbcd95ed914ba84f33f571a0ef7adfa.tar.gz linux-stable-a3c874200cbcd95ed914ba84f33f571a0ef7adfa.tar.bz2 linux-stable-a3c874200cbcd95ed914ba84f33f571a0ef7adfa.zip |
mlx5: Fix missing device local_dma_lkey
The mlx5 driver exposes device capability IB_DEVICE_LOCAL_DMA_LKEY
but does not set the the device local_dma_lkey. This breaks
rpcrdma drivers.
Query and set this lkey when creating the device resources.
Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw')
-rw-r--r-- | drivers/infiniband/hw/mlx5/main.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index 085c24b4b603..5ab5bb3feb97 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -1256,10 +1256,18 @@ static int create_dev_resources(struct mlx5_ib_resources *devr) struct ib_srq_init_attr attr; struct mlx5_ib_dev *dev; struct ib_cq_init_attr cq_attr = {.cqe = 1}; + u32 rsvd_lkey; int ret = 0; dev = container_of(devr, struct mlx5_ib_dev, devr); + ret = mlx5_core_query_special_context(dev->mdev, &rsvd_lkey); + if (ret) { + pr_err("Failed to query special context %d\n", ret); + return ret; + } + dev->ib_dev.local_dma_lkey = rsvd_lkey; + devr->p0 = mlx5_ib_alloc_pd(&dev->ib_dev, NULL, NULL); if (IS_ERR(devr->p0)) { ret = PTR_ERR(devr->p0); @@ -1421,7 +1429,6 @@ static void *mlx5_ib_add(struct mlx5_core_dev *mdev) strlcpy(dev->ib_dev.name, "mlx5_%d", IB_DEVICE_NAME_MAX); dev->ib_dev.owner = THIS_MODULE; dev->ib_dev.node_type = RDMA_NODE_IB_CA; - dev->ib_dev.local_dma_lkey = 0 /* not supported for now */; dev->num_ports = MLX5_CAP_GEN(mdev, num_ports); dev->ib_dev.phys_port_cnt = dev->num_ports; dev->ib_dev.num_comp_vectors = |