From patchwork Tue Mar 20 19:59:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10297807 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 A5425602B3 for ; Tue, 20 Mar 2018 20:00:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 90B0028DBF for ; Tue, 20 Mar 2018 20:00:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8117928E1F; Tue, 20 Mar 2018 20:00:02 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, 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 E84BC28DBF for ; Tue, 20 Mar 2018 20:00:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751348AbeCTUAB (ORCPT ); Tue, 20 Mar 2018 16:00:01 -0400 Received: from mail-db5eur01on0050.outbound.protection.outlook.com ([104.47.2.50]:20992 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751269AbeCTT77 (ORCPT ); Tue, 20 Mar 2018 15:59:59 -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; bh=4pK+G02GHybAtQRnjHlfQiKDrDpep34NQo/cZck8NDk=; b=VzFUdcNoP/Gu+psy8aDgxeNr1jJzvafZdnrJ73ZSm5HlhJfduVY2UL6u2DMTnoV3b7TlaQ+f7SrKIpViJEm2fpzYrAUTfeuygIPOesKi8wXdVTkRSTkkpV0hTCMnolsuhqaWLJ2VCEEaVTed38B5qsHU5U8y/uLD5vto1gTMCU4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=jgg@mellanox.com; Received: from mlx.ziepe.ca (174.3.196.123) by AM6PR05MB4456.eurprd05.prod.outlook.com (2603:10a6:209:43::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.567.14; Tue, 20 Mar 2018 19:59:57 +0000 Received: from jgg by mlx.ziepe.ca with local (Exim 4.86_2) (envelope-from ) id 1eyNQE-00014c-ES; Tue, 20 Mar 2018 13:59:50 -0600 Date: Tue, 20 Mar 2018 13:59:50 -0600 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org, Steve Wise Subject: [PATCH] RDMA/cxgb3: Use structs to describe the uABI instead of opencoding Message-ID: <20180320195950.GA4095@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: HE1PR0102CA0053.eurprd01.prod.exchangelabs.com (2603:10a6:7:7d::30) To AM6PR05MB4456.eurprd05.prod.outlook.com (2603:10a6:209:43::25) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 27e9eee7-042a-4e7b-4287-08d58e9d27ee X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:AM6PR05MB4456; X-Microsoft-Exchange-Diagnostics: 1; AM6PR05MB4456; 3:bGk/iITgpXBUASXnPDmmfSdunXn2PYDDj3P4yU+83Tdzs+/qw1rYAodP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eakvaKqvsVC1XvHtBJ9LwqeNPMUQAwX+1syd1amgnJRVxWqhKrbwFV1v1p9+2C7SXDBzudY76NypDusYIvYfbAv89cFfQyvElp9RxXY1WN7MdNknpHMt81/5RAgyVNTAWTGoHuqrm78gEy65W82VUauSutPjXwPxufGGZkc6pN9D8ebqkfc0cWqvthnm+S4Cl+IrvCI9dWBOExvBvYcOc839GulvA0Q9g3wrbYKDJTPZZAuh5MK4BewtnVRA1bUtmkHIeDgbm1PgllC/ZdrHnSEAfcT; 4:+sdKSksKlFPL1HYVJb6yKsIpWPWfHjo68ETp6yDP+7CnhbtsCdMLJuYIMUmJZD9GFaBVBP+UCsyyRpKFE0kGl/ZBljITIa02w4CIEOpX5oOZURFVDYndp0je0RhVPOaKOCqb/pehSdNquWth50HpQ56L4XgoKjQaNdAZoM995Giumt4y1hMybeHEBFeBjwniaeNIezIek+5F3AXNc5XgGK8XFso45v+Wzp3nHiSkY8uWNkgZY85LsfXf6K7GwQIs9o6ftVG4ZN+4jf4L8tsY2Q== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(3231221)(944501314)(52105095)(10201501046)(93006095)(93001095)(6055026)(6041310)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:AM6PR05MB4456; BCL:0; PCL:0; RULEID:; SRVR:AM6PR05MB4456; X-Forefront-PRVS: 061725F016 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(376002)(396003)(39860400002)(39380400002)(366004)(189003)(199004)(57986006)(83796002)(305945005)(59450400001)(36756003)(2906002)(23726003)(52116002)(6916009)(7736002)(58126008)(33656002)(97736004)(16586007)(68736007)(186003)(1857600001)(69596002)(106356001)(386003)(316002)(50466002)(26005)(86362001)(575784001)(8676002)(33896004)(81166006)(9686003)(81156014)(5660300001)(9786002)(9746002)(8936002)(122856001)(6116002)(46656002)(66066001)(53936002)(478600001)(105586002)(47776003)(3846002)(1076002)(18370500001)(24400500001)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR05MB4456; H:mlx.ziepe.ca; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM6PR05MB4456; 23:dtsNDUkI6rOwUQg71MvHJD7w2i7zblSAC/Iw4hdKQ?= =?us-ascii?Q?v7DUyNHJ2LMbVaY4wpjpB5huxIKdWYNmLFIThe6RknPHvWnzHIHSK7WCNHYR?= =?us-ascii?Q?Dcizu3ngqZjIOMyTXJoIlyAG+tp7t7yAu/5Wvq49ULm2VSV1mQI8+2CaKqze?= =?us-ascii?Q?zqg1UiexilEmjCV+Ypqlb8vByNUKE+UEsDTclyW4Abv0/z8Lx4epcDQFMUda?= =?us-ascii?Q?Wr3j6CU+tqEA4RMXcz5qL70ifk7TBP3NbwDdn1Kbd6V+TH4TV3A+HA30dwk3?= =?us-ascii?Q?jsoSM6g42L4bxhVMACruNoabx+1y8l+bbXjWrZ2nDLegCjsIu7g+nrMXJ4Hg?= =?us-ascii?Q?p/qFKe/fuYmf11pScB6vpoiggKxf4CRpQL/qn/YbUVX8yKEPKqf/j/Nv3k7i?= =?us-ascii?Q?tbrE1tebQcsSM7SZ/kbvjd5VwMXlyh7MKTs6v2ot/Hp88HhHJUoY9NqmvcoZ?= =?us-ascii?Q?fs7e90oAyOe9DbFJ0RUH9DdbzhKKZ0qckbj0dsqQZ5Emd/ZAwJiyM8ftU/Pa?= =?us-ascii?Q?c4Wxlni6tMBRFY7AUJy6KYQYZHHbswvpdVb97sJj5DesLfpvNRx3NuXTBu7p?= =?us-ascii?Q?26/9qVigLhGi549ihDLeHRVNRGUirvRzFtYbHPDtamWogWV6u7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mY4oZ/A0hTRY7qsLdIf7ViELFPki/mfbjAzWMgqjwLKncb52coWyMOvNzMPPtPObtV+TUzEDORGZ/eyKOoDnraf18wOMYTwuFYMnOEryyep7+RFPWN2ogSOhFmvvSuUWsNe9wdjtmD5xWWejDViy9GiKjkmptT1O88whdc2WUDaDNgrqBlEVSKDVZ/WjJxke0AP1whO7WOVaKoB5BD3yy1bkVkEWUdOZM98M90PoHJ2P3FqhVtyMk3WWVCyzGZL7qZEaztlXwoWV0Qt+T1rygH8kT7T0T2cwANk108os4k43RKXdlJ2xRCns2KgjDZe6p2ZGqxbnerlVP6lGeKp1s1UCt2CVFemxngU=; 5:ytTUXCMMZb2qT+HsZyP1htYIjlVXsH2nyxYKZ9HtBe5JSQ5zV8uvvDh4GscC2Ob+nEjKesDrEzViVs46GIHdilU+JPW2uSRD9FP09vH+N9t+7CYxSNTb/5TATGgFKtiEdrVdkYNDcdKtBvWeDNcBiR4z1UhS3fuwjPL8xHVck5s=; 24:MZwdDQsgfVvegDGiVswqYj81LDLLcPKbRrjIu7+ESL1IirgpGBaI438ryX1aPxldvTR6YWUOTWh/kz5QS6NcJpe+k/K/EAnesUn98iDflHc=; 7:CV0iRiXeLxruItpYBHfyQQv0jRXLAUnGt4n27KiK2UHBHKu0hwyUJlMWf2QW0SY6GVZtAH180b5Z/+87GGxuqecEKFx4ZbdCU+3CpN9hzdUWGcYrzNcTFS1m0fGEp2hmvtsPBA0hToJwD6SpOFlXUJgw7jfZ3CuIZKjkbBo0L7dPAQ5TZbcZv5JjF4bWIzFVYlNpHx2uOIs7rhadEClMcPmUlkVoN1itRjYGdEgNuehWTLo2wWKcl9JFzxPavRuB SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Mar 2018 19:59:57.1385 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 27e9eee7-042a-4e7b-4287-08d58e9d27ee X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB4456 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 Open coding a loose value is not acceptable for describing the uABI in RDMA. Provide the missing struct. Signed-off-by: Jason Gunthorpe Acked-by: Steve Wise --- drivers/infiniband/hw/cxgb3/iwch_provider.c | 4 +++- include/uapi/rdma/cxgb3-abi.h | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) Same thing as for cxgb4 diff --git a/drivers/infiniband/hw/cxgb3/iwch_provider.c b/drivers/infiniband/hw/cxgb3/iwch_provider.c index 1804b6c4a6ec13..be097c6723c0f2 100644 --- a/drivers/infiniband/hw/cxgb3/iwch_provider.c +++ b/drivers/infiniband/hw/cxgb3/iwch_provider.c @@ -440,7 +440,9 @@ static struct ib_pd *iwch_allocate_pd(struct ib_device *ibdev, php->pdid = pdid; php->rhp = rhp; if (context) { - if (ib_copy_to_udata(udata, &php->pdid, sizeof (__u32))) { + struct iwch_alloc_pd_resp resp = {.pdid = php->pdid}; + + if (ib_copy_to_udata(udata, &resp, sizeof(resp))) { iwch_deallocate_pd(&php->ibpd); return ERR_PTR(-EFAULT); } diff --git a/include/uapi/rdma/cxgb3-abi.h b/include/uapi/rdma/cxgb3-abi.h index bb1c582c4ff07c..9acb4b7a624633 100644 --- a/include/uapi/rdma/cxgb3-abi.h +++ b/include/uapi/rdma/cxgb3-abi.h @@ -74,4 +74,9 @@ struct iwch_create_qp_resp { struct iwch_reg_user_mr_resp { __u32 pbl_addr; }; + +struct iwch_alloc_pd_resp { + __u32 pdid; +}; + #endif /* CXGB3_ABI_USER_H */