summaryrefslogtreecommitdiff
path: root/include/rdma
diff options
context:
space:
mode:
authorGal Pressman <galpress@amazon.com>2019-01-22 10:08:22 +0200
committerJason Gunthorpe <jgg@mellanox.com>2019-01-30 20:32:25 -0700
commit6780c4fa9d6e091b2f206ac429a40e2e8d2e45f3 (patch)
treed53b9ef08b0a56df944b780549bd81674afdb6d3 /include/rdma
parent459cc69fa4c17caf21de596693d8a07170820a58 (diff)
RDMA: Add indication for in kernel API support to IB device
Drivers that do not provide kernel verbs support should not be used by ib kernel clients at all. In case a device does not implement all mandatory verbs for kverbs usage mark it as a non kverbs provider and prevent its usage for all clients except for uverbs. The device is marked as a non kverbs provider using the 'kverbs_provider' flag which should only be set by the core code. The clients can choose whether kverbs are requested for its usage using the 'no_kverbs_req' flag which is currently set for uverbs only. This patch allows drivers to remove mandatory verbs stubs and simply set the callbacks to NULL. The IB device will be registered as a non-kverbs provider. Note that verbs that are required for the device registration process must be implemented. Signed-off-by: Gal Pressman <galpress@amazon.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'include/rdma')
-rw-r--r--include/rdma/ib_verbs.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index a1a1e710642c..4183a03b46b5 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -2565,6 +2565,8 @@ struct ib_device {
__be64 node_guid;
u32 local_dma_lkey;
u16 is_switch:1;
+ /* Indicates kernel verbs support, should not be used in drivers */
+ u16 kverbs_provider:1;
u8 node_type;
u8 phys_port_cnt;
struct ib_device_attr attrs;
@@ -2619,6 +2621,9 @@ struct ib_client {
const struct sockaddr *addr,
void *client_data);
struct list_head list;
+
+ /* kverbs are not required by the client */
+ u8 no_kverbs_req:1;
};
struct ib_device *_ib_alloc_device(size_t size);