aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/verbs.c
diff options
context:
space:
mode:
authorOr Gerlitz <ogerlitz@mellanox.com>2015-12-18 10:59:45 +0200
committerDoug Ledford <dledford@redhat.com>2015-12-22 14:39:00 -0500
commit86bee4c9c126b4f73e3f152cd43c806cac9135ad (patch)
treec57b8c7a04f0a415549f5cd2d1c9195ae9a16e20 /drivers/infiniband/core/verbs.c
parentIB/core: Save the device attributes on the device structure (diff)
downloadlinux-dev-86bee4c9c126b4f73e3f152cd43c806cac9135ad.tar.xz
linux-dev-86bee4c9c126b4f73e3f152cd43c806cac9135ad.zip
IB/core: Avoid calling ib_query_device
Use the cached copy of the attributes present on the device, except for the case of a query originating from user-space, where we have to invoke the driver query_device entry, so they can fill in their udata. Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/core/verbs.c')
-rw-r--r--drivers/infiniband/core/verbs.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
index 545906dec26d..7617d947fcde 100644
--- a/drivers/infiniband/core/verbs.c
+++ b/drivers/infiniband/core/verbs.c
@@ -229,12 +229,6 @@ EXPORT_SYMBOL(rdma_port_get_link_layer);
struct ib_pd *ib_alloc_pd(struct ib_device *device)
{
struct ib_pd *pd;
- struct ib_device_attr devattr;
- int rc;
-
- rc = ib_query_device(device, &devattr);
- if (rc)
- return ERR_PTR(rc);
pd = device->alloc_pd(device, NULL, NULL);
if (IS_ERR(pd))
@@ -245,7 +239,7 @@ struct ib_pd *ib_alloc_pd(struct ib_device *device)
pd->local_mr = NULL;
atomic_set(&pd->usecnt, 0);
- if (devattr.device_cap_flags & IB_DEVICE_LOCAL_DMA_LKEY)
+ if (device->attrs.device_cap_flags & IB_DEVICE_LOCAL_DMA_LKEY)
pd->local_dma_lkey = device->local_dma_lkey;
else {
struct ib_mr *mr;