RDMA/core Remove uverbs_ex_cmd_mask
authorJason Gunthorpe <jgg@nvidia.com>
Sat, 3 Oct 2020 23:20:09 +0000 (20:20 -0300)
committerJason Gunthorpe <jgg@nvidia.com>
Mon, 26 Oct 2020 22:27:59 +0000 (19:27 -0300)
No driver sets it, and the core code sets a maximum mask, simply remove
it.

Disabled operations are now handled either by having a NULL ops pointer,
or by having the common driver callbacks check for unsupported extended
attributes.

Link: https://lore.kernel.org/r/9-v1-caa70ba3d1ab+1436e-ucmd_mask_jgg@nvidia.com
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/core/device.c
drivers/infiniband/core/uverbs_uapi.c
include/rdma/ib_verbs.h

index e5f5d656951df1aea419c099902d6a2afa7ab7c8..939664765536c6db0895c54cf862a096def0b36c 100644 (file)
@@ -630,21 +630,6 @@ struct ib_device *_ib_alloc_device(size_t size)
                BIT_ULL(IB_USER_VERBS_CMD_REG_MR) |
                BIT_ULL(IB_USER_VERBS_CMD_REREG_MR) |
                BIT_ULL(IB_USER_VERBS_CMD_RESIZE_CQ);
-
-       device->uverbs_ex_cmd_mask =
-               BIT_ULL(IB_USER_VERBS_EX_CMD_CREATE_CQ) |
-               BIT_ULL(IB_USER_VERBS_EX_CMD_CREATE_FLOW) |
-               BIT_ULL(IB_USER_VERBS_EX_CMD_CREATE_QP) |
-               BIT_ULL(IB_USER_VERBS_EX_CMD_CREATE_RWQ_IND_TBL) |
-               BIT_ULL(IB_USER_VERBS_EX_CMD_CREATE_WQ) |
-               BIT_ULL(IB_USER_VERBS_EX_CMD_DESTROY_FLOW) |
-               BIT_ULL(IB_USER_VERBS_EX_CMD_DESTROY_RWQ_IND_TBL) |
-               BIT_ULL(IB_USER_VERBS_EX_CMD_DESTROY_WQ) |
-               BIT_ULL(IB_USER_VERBS_EX_CMD_MODIFY_CQ) |
-               BIT_ULL(IB_USER_VERBS_EX_CMD_MODIFY_QP) |
-               BIT_ULL(IB_USER_VERBS_EX_CMD_MODIFY_WQ) |
-               BIT_ULL(IB_USER_VERBS_EX_CMD_QUERY_DEVICE);
-
        return device;
 }
 EXPORT_SYMBOL(_ib_alloc_device);
index 5addc8fae3f3bd9083d2e59fac0662f9f0296aeb..62f5bcb712cf172dbac482335a8632eaec7d12a0 100644 (file)
@@ -79,10 +79,7 @@ static int uapi_create_write(struct uverbs_api *uapi,
 
        method_elm->is_ex = def->write.is_ex;
        method_elm->handler = def->func_write;
-       if (def->write.is_ex)
-               method_elm->disabled = !(ibdev->uverbs_ex_cmd_mask &
-                                        BIT_ULL(def->write.command_num));
-       else
+       if (!def->write.is_ex)
                method_elm->disabled = !(ibdev->uverbs_cmd_mask &
                                         BIT_ULL(def->write.command_num));
 
index 0f9ce27bedcb5d36f9d2fad6dcc809bf4339008f..c7c6b06171e934d4ed7c07fb9de743af398efb22 100644 (file)
@@ -2667,7 +2667,6 @@ struct ib_device {
        const struct attribute_group    *groups[3];
 
        u64                          uverbs_cmd_mask;
-       u64                          uverbs_ex_cmd_mask;
 
        char                         node_desc[IB_DEVICE_NODE_DESC_MAX];
        __be64                       node_guid;