From patchwork Fri Jan 26 22:16:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10187125 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 CFCA360211 for ; Fri, 26 Jan 2018 22:17:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ABA142A7E1 for ; Fri, 26 Jan 2018 22:17:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 98F592A7E5; Fri, 26 Jan 2018 22:17:00 +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 D5EED2A7E1 for ; Fri, 26 Jan 2018 22:16:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751450AbeAZWQ6 (ORCPT ); Fri, 26 Jan 2018 17:16:58 -0500 Received: from mail-eopbgr30081.outbound.protection.outlook.com ([40.107.3.81]:58624 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751409AbeAZWQ5 (ORCPT ); Fri, 26 Jan 2018 17:16:57 -0500 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=VbRwhBwE9vn54i9ZNuRjhdkDUXz2qRb7Kyz9oK+iMe0=; b=xugXUV3cegKvFcSFfy8m5j7Ywc7gIV2tcEJbeoNrsyvw0EUeUp+NTykfkYnAk4wjg9h8UPyHH4J7ydlxGX0ekgCpfGM/g9bXr5nnkE9P3SlV/vLUYEaU0WkFX+nd5sGQfepvCUa6vHfd3OyvxIXFGTYWQ+uZf6P67awJjmDLis4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=jgg@mellanox.com; Received: from mlx.ziepe.ca (70.74.179.152) by DB6PR0501MB2854.eurprd05.prod.outlook.com (2603:10a6:4:83::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.444.14; Fri, 26 Jan 2018 22:16:54 +0000 Received: from jgg by mlx.ziepe.ca with local (Exim 4.86_2) (envelope-from ) id 1efCIg-0001Nt-VA for linux-rdma@vger.kernel.org; Fri, 26 Jan 2018 15:16:46 -0700 Date: Fri, 26 Jan 2018 15:16:46 -0700 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Subject: [PATCH] RDMA: Move enum ib_cq_creation_flags to uapi headers Message-ID: <20180126221646.GA5251@ziepe.ca> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [70.74.179.152] X-ClientProxiedBy: HE1P191CA0001.EURP191.PROD.OUTLOOK.COM (2603:10a6:3:cf::11) To DB6PR0501MB2854.eurprd05.prod.outlook.com (2603:10a6:4:83::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 350f6da0-604d-46c1-30d0-08d5650a81e3 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:DB6PR0501MB2854; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0501MB2854; 3:TqPvVQMbMlVzQiTBuT6UrmEKBu/tr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JQ+PDFxdmnUMDR0NmaXe115pxHICDvzzrXWtdpUf26BdGr12p91GjwOV0JMKslW42Oh2N2RLbWAvgalxj9F9LdJzvMABWYeR321QdCJvCPpTG4sUq0TrqPn9RHlNAy/JlKkX91nNHca8j9iwuxxLK0G0SMXq/IOw6iqCTLm3HCqg1LIbsN8v/wIKoupIFOUl+YYJd2Xa8lrg+FAjUj6y5DyU9yzUM6P+5EzkiL9+CpJYKUzo6nY3mgmlFBFKOL53qEaib6hYEdJn1ox/Op/nOFlwkHg9YIgn+Lq5fO5CdOkALiDCrKiAotG+PoZLG79/NjtdwO0lgPtaO8EHDVN0q51s; 4:fGy3Q2Y9ewt8OtvNfEI4ZzqRtFDc0pXRlDNSOQm28bBvFIzyAdE+3ph5FV8hBxHCcmPuvpprdGVBrh5f6YRew7/FbboMU5FBrvGFdRkOneaFsHliz1bqRmTK6i54YQiY1cfEVQKy+d+e4Rf2Lz7iuYWASGi4vhbI90GO+igt1PEoujOuKugDLCc4smB1b1Dhveii98ENf9bzj1staYrKoslHQ0ywk1yieJTUBUGUI/gF9006XYUQNy1AcpA8gswlRG0cdrFvlvdOyuDHCmxnHg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(3231078)(2400081)(944501161)(10201501046)(6055026)(6041288)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(6072148)(201708071742011); SRVR:DB6PR0501MB2854; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0501MB2854; X-Forefront-PRVS: 05641FD966 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(396003)(366004)(39860400002)(39380400002)(376002)(199004)(189003)(1076002)(5660300001)(33656002)(36756003)(316002)(3846002)(16586007)(6916009)(58126008)(6116002)(50466002)(52116002)(53936002)(33896004)(105586002)(386003)(23726003)(478600001)(2906002)(122856001)(59450400001)(9686003)(97736004)(83796002)(57986006)(106356001)(2351001)(86362001)(8676002)(8936002)(9746002)(305945005)(9786002)(46656002)(66066001)(575784001)(2361001)(83506002)(81166006)(81156014)(186003)(26005)(7736002)(69596002)(68736007)(47776003)(18370500001)(24400500001)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0501MB2854; H:mlx.ziepe.ca; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX: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; DB6PR0501MB2854; 23:lZHIqNa7BHHAQG7HAwI0FktNKAXkyrU+82WEm/I?= =?us-ascii?Q?NjF3Fb/XDVUEs/2+8dP1/fhPsuyMaG0LYnZ0UpW5fPz5Zz+s0EiCFBpNpPrO?= =?us-ascii?Q?bA2E7M0j0wUsC+cTrOzADE/A7ZzAGxQBgfC93WheLWcMhuNhcWdgGda7Afz5?= =?us-ascii?Q?rJ1Y4xLOSuVck1tOU3uVptXFQoZ989cQw6U/04AuP6SR6ihcJnY0ExfZxoET?= =?us-ascii?Q?4qtWfQ4X2QF9mqZGfU8+MDbG07ytzWFzVy4/bzhMvCX0T4SULn07zqvrZnz4?= =?us-ascii?Q?CmkCy79rjRMgUXZagbgpyQnEFsYMrss5zGlvLkTBp8bq63s29t4bjfJif2h5?= =?us-ascii?Q?hPko3xpn7ieWlCpJEiBgcqxpfgT19N1R1fOQ9/ZrURC0C0dS0SJozWRWp5L3?= =?us-ascii?Q?FXpYeqcOJl2XD5p2WYgbsq8yjvku0Be8rGPKTs5Xm+lGdy72l6gQ6yYcnJhm?= =?us-ascii?Q?PmOjDzYfNrMHwdJCqlVs9dE7ONEFjbwHd0z1YsbaYlMa22ZSZ8ybeh3zWxYX?= =?us-ascii?Q?NIppLNxwbSXtktxpUntcEanLkXbDlP0craxYPsUuxUQshJytTwFQx1tn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Z/iZ+cE7ybnS+zn6bI+yoIxzPeSHsDlmUOwW/W9gXRcp7NWi/ujSXffdiJZORdnDvpVWcgFXidsITOXYMGWb6sZsuz2Ka+S0M5kRTi/a6as+zx7I1qjWbQVf9d6g751vfGAmzH7cwb6BlakCaBYyJFdOai9jrkHOMGHsKIsDehcEJ4f0AKzMItWQoEmiIY1bZmgYJ0Ob7ALmDBsH6e8X6I5UO1iqWsyELoEu1CKs4+IFKRLoYTNIv2WfyTuqwwF6lSA4MQIpQi3SA=; 5:ffCJxdw/ENSFAb7fv7gFvTv3Y1K2wY6FO1yglKK0dROYK2U+FPB3m6+cXIDPT0rJ/toiFnuWWvf7nLi79LxuavBiK5ioBl9HqvHgCC0qola565eSX9LFUPpOOf6UAzK6+T4IMHsj4ZmVtOMG0hJvqZp9VF/WgoZjJYfJRNjdLs8=; 24:FU8OdOIBBY5mpTDsuQvE/hbJSH8jRfDinnm4xCsTxylzTvaIo/+/r7o5/wvTuys0+IL+u25S+uN3eh8ohQkBqOqg3KK3GNu4/gJEQI8hI1w=; 7:jkdmWFgn1xGN+hPM2Mox/eBHkgjK9clrOnFzzV2V8/0GEgx4AP5Av3sCGUBysq4S8rgkVKdAxFEBt1yHZFO/xPc/9J2OMn8fb3aKMKtwes0MeXKRSi7i3Ob5ucMaG2th20AJ/OmyZhikask0Ejc+aJgHEbea9ZdgAxPc8F0HFefN4wypG1sNe/SbDMYgth1FGJ80DPFm3l+4O+VPJlOqMvVuKOLvSjZC19vtuFIatE1sDAI3XRmw/moTpS2V3nFz SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2018 22:16:54.3677 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 350f6da0-604d-46c1-30d0-08d5650a81e3 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0501MB2854 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 The flags field the enum is used with comes directly from the uapi so it belongs in the uapi headers for clarity and so userspace can use it. Signed-off-by: Jason Gunthorpe --- drivers/infiniband/hw/mlx4/cq.c | 4 ++-- drivers/infiniband/hw/mlx5/cq.c | 2 +- drivers/infiniband/hw/mlx5/mlx5_ib.h | 4 ++-- include/rdma/ib_verbs.h | 5 ----- include/uapi/rdma/ib_user_verbs.h | 7 ++++++- 5 files changed, 11 insertions(+), 11 deletions(-) This is the last copied enum in libibverbs's kern-abi.h diff --git a/drivers/infiniband/hw/mlx4/cq.c b/drivers/infiniband/hw/mlx4/cq.c index bf4f14a1b4fcbe..9a566ee3ceffef 100644 --- a/drivers/infiniband/hw/mlx4/cq.c +++ b/drivers/infiniband/hw/mlx4/cq.c @@ -170,7 +170,7 @@ static int mlx4_ib_get_cq_umem(struct mlx4_ib_dev *dev, struct ib_ucontext *cont return err; } -#define CQ_CREATE_FLAGS_SUPPORTED IB_CQ_FLAGS_TIMESTAMP_COMPLETION +#define CQ_CREATE_FLAGS_SUPPORTED IB_UVERBS_CQ_FLAGS_TIMESTAMP_COMPLETION struct ib_cq *mlx4_ib_create_cq(struct ib_device *ibdev, const struct ib_cq_init_attr *attr, struct ib_ucontext *context, @@ -246,7 +246,7 @@ struct ib_cq *mlx4_ib_create_cq(struct ib_device *ibdev, err = mlx4_cq_alloc(dev->dev, entries, &cq->buf.mtt, uar, cq->db.dma, &cq->mcq, vector, 0, - !!(cq->create_flags & IB_CQ_FLAGS_TIMESTAMP_COMPLETION)); + !!(cq->create_flags & IB_UVERBS_CQ_FLAGS_TIMESTAMP_COMPLETION)); if (err) goto err_dbmap; diff --git a/drivers/infiniband/hw/mlx5/cq.c b/drivers/infiniband/hw/mlx5/cq.c index 18705cbcdc8c17..5b974fb97611bc 100644 --- a/drivers/infiniband/hw/mlx5/cq.c +++ b/drivers/infiniband/hw/mlx5/cq.c @@ -1010,7 +1010,7 @@ struct ib_cq *mlx5_ib_create_cq(struct ib_device *ibdev, MLX5_SET(cqc, cqc, uar_page, index); MLX5_SET(cqc, cqc, c_eqn, eqn); MLX5_SET64(cqc, cqc, dbr_addr, cq->db.dma); - if (cq->create_flags & IB_CQ_FLAGS_IGNORE_OVERRUN) + if (cq->create_flags & IB_UVERBS_CQ_FLAGS_IGNORE_OVERRUN) MLX5_SET(cqc, cqc, oi, 1); err = mlx5_core_create_cq(dev->mdev, &cq->mcq, cqb, inlen); diff --git a/drivers/infiniband/hw/mlx5/mlx5_ib.h b/drivers/infiniband/hw/mlx5/mlx5_ib.h index 69a80f7512f094..1393851299738d 100644 --- a/drivers/infiniband/hw/mlx5/mlx5_ib.h +++ b/drivers/infiniband/hw/mlx5/mlx5_ib.h @@ -1123,8 +1123,8 @@ static inline u32 check_cq_create_flags(u32 flags) * It returns non-zero value for unsupported CQ * create flags, otherwise it returns zero. */ - return (flags & ~(IB_CQ_FLAGS_IGNORE_OVERRUN | - IB_CQ_FLAGS_TIMESTAMP_COMPLETION)); + return (flags & ~(IB_UVERBS_CQ_FLAGS_IGNORE_OVERRUN | + IB_UVERBS_CQ_FLAGS_TIMESTAMP_COMPLETION)); } static inline int verify_assign_uidx(u8 cqe_version, u32 cmd_uidx, diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 5e32fe781ca30d..0b29425868403b 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h @@ -300,11 +300,6 @@ struct ib_tm_caps { u32 max_sge; }; -enum ib_cq_creation_flags { - IB_CQ_FLAGS_TIMESTAMP_COMPLETION = 1 << 0, - IB_CQ_FLAGS_IGNORE_OVERRUN = 1 << 1, -}; - struct ib_cq_init_attr { unsigned int cqe; int comp_vector; diff --git a/include/uapi/rdma/ib_user_verbs.h b/include/uapi/rdma/ib_user_verbs.h index fd035641cf41ce..04d0e67b13120c 100644 --- a/include/uapi/rdma/ib_user_verbs.h +++ b/include/uapi/rdma/ib_user_verbs.h @@ -402,13 +402,18 @@ struct ib_uverbs_create_cq { __u64 driver_data[0]; }; +enum ib_uverbs_ex_create_cq_flags { + IB_UVERBS_CQ_FLAGS_TIMESTAMP_COMPLETION = 1 << 0, + IB_UVERBS_CQ_FLAGS_IGNORE_OVERRUN = 1 << 1, +}; + struct ib_uverbs_ex_create_cq { __u64 user_handle; __u32 cqe; __u32 comp_vector; __s32 comp_channel; __u32 comp_mask; - __u32 flags; + __u32 flags; /* bitmask of ib_uverbs_ex_create_cq_flags */ __u32 reserved; };