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>
Orabug:
27687711
Signed-off-by: Gerd Rausch <gerd.rausch@oracle.com>
(cherry-picked from upstream
86bee4c9c126b4f73e3f152cd43c806cac9135ad)
Reviewed-by: HÃ¥kon Bugge <haakon.bugge@oracle.com>
Conflicts:
drivers/infiniband/core/uverbs_cmd.c
o Function "ib_uverbs_get_context":
In UEK it's "ibdev", taken from "file->device->ib_dev"
Upstream it's "ib_dev", introduced by:
commit
057aec0d23f750b27f0bb92d2606871f60417e0a
Author: Yishai Hadas <yishaih@mellanox.com>
Date: Thu Aug 13 18:32:04 2015 +0300
IB/uverbs: Explicitly pass ib_dev to uverbs commands
The earliest linux-4.x.y it showed up in was x==3, or rather "linux-4.3.y".
o Function "ib_uverbs_query_device":
Just like before, UEK does not have "ib_dev", so using
"file->device->ib_dev" instead.
This follows precedence of the deleted code, where "ib_query_device"
was called with "file->device->ib_dev" in UEK.
drivers/infiniband/core/verbs.c
The handling of "IB_DEVICE_LOCAL_DMA_LKEY" inside "ib_alloc_pd" was introduced with:
commit
96249d70dd70496084c7ec1465ec449cd032955a
Author: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Date: Wed Aug 5 14:14:45 2015 -0600
IB/core: Guarantee that a local_dma_lkey is available
The earliest linux-4.x.y it showed up in was x==3, or rather "linux-4.3.y".
Since UEK is/was based on 4.1, the corresponding code does not exist here.