From patchwork Fri Jul 6 17:42:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10512229 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 15B85603D7 for ; Fri, 6 Jul 2018 17:42:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F2E2E28759 for ; Fri, 6 Jul 2018 17:42:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E54BC28761; Fri, 6 Jul 2018 17:42:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8240928759 for ; Fri, 6 Jul 2018 17:42:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933661AbeGFRmN (ORCPT ); Fri, 6 Jul 2018 13:42:13 -0400 Received: from mail-eopbgr00045.outbound.protection.outlook.com ([40.107.0.45]:28134 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933230AbeGFRmM (ORCPT ); Fri, 6 Jul 2018 13:42:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=v+Z4aRDkfeTkHS84YeV6CNDf1lTUMxQw4EP0DQ9tw/s=; b=hm2Ksq7PFs3wgN7Uo0MZcHuHHprDQgI/liL8pOLyfGga8kmg0UYatRgmbSDvVoK9ZVXPfMQy0LP88B09FU/IB++EWkV9YYRzO9GR5ibjvuJawcoNxQgIhsB5Bjbaq96Uat44SgI7LGeujBjc/x8BX4mrJMxAQ2+DprkyDtfcrDk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=jgg@mellanox.com; Received: from mlx.ziepe.ca (174.3.196.123) by AM0PR05MB4450.eurprd05.prod.outlook.com (2603:10a6:208:5a::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.930.21; Fri, 6 Jul 2018 17:42:09 +0000 Received: from jgg by mlx.ziepe.ca with local (Exim 4.86_2) (envelope-from ) id 1fbUk7-0008SB-AC; Fri, 06 Jul 2018 11:42:03 -0600 Date: Fri, 6 Jul 2018 11:42:03 -0600 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org, Leon Romanovsky Subject: [PATCH] IB/uverbs: Do not use uverbs_cmd_mask in the ioctl path Message-ID: <20180706174203.GA32472@ziepe.ca> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [174.3.196.123] X-ClientProxiedBy: HE1PR05CA0150.eurprd05.prod.outlook.com (2603:10a6:7:28::37) To AM0PR05MB4450.eurprd05.prod.outlook.com (2603:10a6:208:5a::23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1b338b97-3870-4922-5c43-08d5e367ccbe X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:AM0PR05MB4450; X-Microsoft-Exchange-Diagnostics: 1; AM0P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p4awwZyVtZsKzvWFBkzg4fHfP4caUcISZJsqM7jabHu08VlZY5Lj5w01sXk4ytVJd8VvjvgHidbcbrhER9H9StCUyyuJmUhY6Cb0RfSQQgeO1O2eOcJGNRzhnIviUIDJDIEr9bDHCiMCqf+vbUjFuJd7Go784aCscEtAr7b9hE2xg+rNm5ob+bAEjeH9AV2uThcw80MOAGoxB+u5k5nMjOdTWbe3BQgPwOvBSinFyBVC6aZcWQzc58jG4IFXvfGKI1IQepANlfWq5NQVx+p5+1yko5z5IuRS/tNMmgvLnU/mvEjLcS7xNVdG4OhjMytLDJEMv1n6Oe2kqrDrAPlLoD2T/6Ujxd/hiaOaQ6Hx9pOJiAEyb14x; 4:OSgHyYf+SwGfoFtuip5xUAWefaNx960yCAXonpXHu3KKCl45j2UGaxLhj6ihAPwNnwf58aVZbrP+/YmRKNhlhE1INTrcDFBNRosjFkuC2N/nKxj+dwwKydTxBB7cEUJxQ/7mnBLRz2g8QdL+2gXkSaxf/NXb9UD5wVPdUBtYaXef3MzNqwDbDM32yNg8CSP5+c1B6exfL7E5oDKCVHQG2j8K0/pJec0xCyZzgYKDKhkNim8MNO/3S/l8vps3JrTwEbHMzXN9+GKtgnMTZ4WAgA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(3231254)(944501410)(52105095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:AM0PR05MB4450; BCL:0; PCL:0; RULEID:; SRVR:AM0PR05MB4450; X-Forefront-PRVS: 0725D9E8D0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39850400004)(376002)(396003)(366004)(346002)(136003)(199004)(189003)(106356001)(57986006)(33896004)(81156014)(8936002)(486006)(81166006)(6636002)(47776003)(386003)(8676002)(476003)(9786002)(9746002)(105586002)(68736007)(305945005)(7736002)(5660300001)(83796002)(23726003)(316002)(86362001)(50466002)(97736004)(122856001)(2906002)(52116002)(6116002)(3846002)(1076002)(16586007)(58126008)(36756003)(69596002)(6862004)(478600001)(1857600001)(186003)(9686003)(26005)(66066001)(46656002)(33656002)(53936002)(18370500001)(24400500001)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR05MB4450; H:mlx.ziepe.ca; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR05MB4450; 23:/OnSNMdhohTiZ08yBTGosa3Jw3lTKKJLTdgxJhKaW?= =?us-ascii?Q?yPOkjlDKwAW+5ovlvKYJnsNRm99GE6M/1t3bdFT85DyLS9DMWSM5XV3hhouy?= =?us-ascii?Q?R56ZX4qI+X1KAQZumj2uAIlwrS+Piy7B9NihBdZVW9+ZgfRLA1AaxrvbzeCq?= =?us-ascii?Q?jyHlK3pinEWQZDg/2586o8zClDqDgc/kfZjaaJgGAZc3TWQACbZon7RswGSo?= =?us-ascii?Q?V/F7rUjIr1p40CV3aM7dT4r4OcX6dmuJyFKIV1cSl7YcXWg2KBmJrHA2H3qq?= =?us-ascii?Q?qpWRUlwGFjGfKEO9+kCA/p6J0QiI7vt7FyOF3X6vjds6Yb+yzylAW/s7L8q5?= =?us-ascii?Q?KIbL1veh8mpUle7caX2FJQdDZtHho/+pOv+Q3yx0n7t/bdaObzIVfG7e3+J2?= =?us-ascii?Q?bGjubWnHsswWXeSC7SP3fQramfWAgtYKpx37Xn3UmfsI9XKNyjIw/5KFtosi?= =?us-ascii?Q?Nu1DkuLFleB1L52Ox09KBxTD/0wysQY4oGQ4kZcLsZVXsGUbbc+YHN506d8S?= =?us-ascii?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osticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM0PR05MB4450; 7://YKh4JSI2KHX+0klrc6dYUtkSeGYOhw4DTfiPrQH2JyC6eiWLDnmvZJ6oGwIu6/YZ7+hQ8IjMES0wTULl7Pu5PUZ1x5XBMxr9KJ8K0IUvQhemnBfItgttm3EMb6FAqOKSXcsN3KGKF7sya2Jh9zFiDMeC31m1oEP8bsdPdT1IxIvS6sYsdSE2S9tiqfHza1EPebt3LaTnTvRPUKzK28AlKT6Pxow2E1liruaGhl6d8OeztIOLLvb9RjwvgDHYCD X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2018 17:42:09.6769 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1b338b97-3870-4922-5c43-08d5e367ccbe X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB4450 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Instead we are now checking the function pointers directly. Get rid of both cases in ioctl and drop the nonsense idea that destroy can fail. Signed-off-by: Jason Gunthorpe Reviewed-by: Leon Romanovsky --- drivers/infiniband/core/uverbs_std_types_cq.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/infiniband/core/uverbs_std_types_cq.c b/drivers/infiniband/core/uverbs_std_types_cq.c index ce9c9c66bae42f..5a6154345fa043 100644 --- a/drivers/infiniband/core/uverbs_std_types_cq.c +++ b/drivers/infiniband/core/uverbs_std_types_cq.c @@ -70,7 +70,7 @@ static int UVERBS_HANDLER(UVERBS_METHOD_CQ_CREATE)(struct ib_device *ib_dev, struct ib_uverbs_completion_event_file *ev_file = NULL; struct ib_uobject *ev_file_uobj; - if (!(ib_dev->uverbs_cmd_mask & 1ULL << IB_USER_VERBS_CMD_CREATE_CQ)) + if (!ib_dev->create_cq || !ib_dev->destroy_cq) return -EOPNOTSUPP; ret = uverbs_copy_from(&attr.comp_vector, attrs, @@ -185,9 +185,6 @@ static int UVERBS_HANDLER(UVERBS_METHOD_CQ_DESTROY)(struct ib_device *ib_dev, obj = container_of(uobj, struct ib_ucq_object, uobject); - if (!(ib_dev->uverbs_cmd_mask & 1ULL << IB_USER_VERBS_CMD_DESTROY_CQ)) - return -EOPNOTSUPP; - ret = rdma_explicit_destroy(uobj); if (ret) return ret;