diff options
author | Or Gerlitz <ogerlitz@mellanox.com> | 2015-12-18 11:59:45 +0300 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2015-12-22 22:39:00 +0300 |
commit | 86bee4c9c126b4f73e3f152cd43c806cac9135ad (patch) | |
tree | c57b8c7a04f0a415549f5cd2d1c9195ae9a16e20 /drivers/infiniband/core/verbs.c | |
parent | 3e153a93a1c12e3354dd38cca414fb51a15136a2 (diff) | |
download | linux-86bee4c9c126b4f73e3f152cd43c806cac9135ad.tar.xz |
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.c | 8 |
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; |