From patchwork Wed Nov 16 08:19:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhijian Li (Fujitsu)" X-Patchwork-Id: 20790 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp22681wru; Wed, 16 Nov 2022 00:26:59 -0800 (PST) X-Google-Smtp-Source: AA0mqf79nc+fi0bZzltfVM0lV7k3jrXCcsrYYi+aSX8jZ9j2eh3UUx9lNZbdJBQrL6upWqJ92KpW X-Received: by 2002:a63:e010:0:b0:476:941a:8582 with SMTP id e16-20020a63e010000000b00476941a8582mr10309640pgh.321.1668587219264; Wed, 16 Nov 2022 00:26:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668587219; cv=none; d=google.com; s=arc-20160816; b=0h0LmfdCyfTXPGAdwu8KUdyHoxJTgq56RbB20ZO/XV6sHqDAX0zSjyBgrghT6AI97R DJ7x8gyHhRJBIWOdSauaVm8lGU65TC3XBfQTBUuvRDWpsiq5UDQAbtn/08nRrr4DKGc+ ZCO2df6oRkgermW8P9xZAB+4kmmNZCbOB9JSVdf87PNn1+VZtLqk6/+Wk7xrxBVKfu+L A5sCd2EMYhs3xUhRC5d5kbfbrLP3mGCB18k4dddvbzc+RJ1Pfz2oO7LZzSTv/C8axF4D rnoz0DqiX6N1YnAb9z2ZG07wUdwu6acHntV+olNRKIzv0kfCiNzt7hIWZRXRek63iPJB lAIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=/v0k6vvzohNdqpTC6xeMzTs0jZ9pC3kCfHNb4HG0N0o=; b=XbbwiPZaIbIAbc6Bojpp8ji7L6J6QU5PLkTbf81LP2oGR+RRrW8HwMUA6gPM5xQ+X4 LmqdFj8VFbvhQ5Qv2+yAzUcfpQPD/v8y+DfKJC4r/xfFdW1wAX1+Xl7YvU9ijdEPs+SU MMZqutnpqTRhnuzks2j3OdvuC9wDm0TNQ33weAwLlL/NzBbBR+2klaFJRarghDh0S3AK GYEcD1Xr2nkuC4DgmHRRUBRWbIPQUyGnUJvBdrC+A4Rck+T+A4JE4Eah/ypjNRtDVkLk ZVdmds/PwiL5fVllAZALEvLDH0KfAVlwFGD5TfmjHNsaCSoXp9CG5wo+MZ6r8mjuPdb2 bj+w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fujitsu.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r3-20020a635143000000b0046fd1008569si14561911pgl.758.2022.11.16.00.26.44; Wed, 16 Nov 2022 00:26:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fujitsu.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233070AbiKPIUg (ORCPT + 99 others); Wed, 16 Nov 2022 03:20:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232401AbiKPIUY (ORCPT ); Wed, 16 Nov 2022 03:20:24 -0500 Received: from esa10.hc1455-7.c3s2.iphmx.com (esa10.hc1455-7.c3s2.iphmx.com [139.138.36.225]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4FBFDC9; Wed, 16 Nov 2022 00:20:22 -0800 (PST) X-IronPort-AV: E=McAfee;i="6500,9779,10532"; a="83953130" X-IronPort-AV: E=Sophos;i="5.96,167,1665414000"; d="scan'208";a="83953130" Received: from unknown (HELO yto-r1.gw.nic.fujitsu.com) ([218.44.52.217]) by esa10.hc1455-7.c3s2.iphmx.com with ESMTP; 16 Nov 2022 17:20:20 +0900 Received: from yto-m2.gw.nic.fujitsu.com (yto-nat-yto-m2.gw.nic.fujitsu.com [192.168.83.65]) by yto-r1.gw.nic.fujitsu.com (Postfix) with ESMTP id 2B4C6D66A3; Wed, 16 Nov 2022 17:20:19 +0900 (JST) Received: from kws-ab2.gw.nic.fujitsu.com (kws-ab2.gw.nic.fujitsu.com [192.51.206.12]) by yto-m2.gw.nic.fujitsu.com (Postfix) with ESMTP id 6F8B6D3553; Wed, 16 Nov 2022 17:20:18 +0900 (JST) Received: from FNSTPC.g08.fujitsu.local (unknown [10.167.226.45]) by kws-ab2.gw.nic.fujitsu.com (Postfix) with ESMTP id 49D2C2340D52; Wed, 16 Nov 2022 17:20:17 +0900 (JST) From: Li Zhijian To: zyjzyj2000@gmail.com, jgg@ziepe.ca, leon@kernel.org, Bob Pearson , linux-rdma@vger.kernel.org Cc: Mark Bloch , Tom Talpey , tomasz.gromadzki@intel.com, Dan Williams , Xiao Yang , y-goto@fujitsu.com, linux-kernel@vger.kernel.org, Li Zhijian Subject: [for-next PATCH v6 01/10] RDMA: Extend RDMA user ABI to support flush Date: Wed, 16 Nov 2022 16:19:42 +0800 Message-Id: <20221116081951.32750-2-lizhijian@fujitsu.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221116081951.32750-1-lizhijian@fujitsu.com> References: <20221116081951.32750-1-lizhijian@fujitsu.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSS-9.1.0.1408-9.0.0.1002-27266.006 X-TM-AS-User-Approved-Sender: Yes X-TMASE-Version: IMSS-9.1.0.1408-9.0.1002-27266.006 X-TMASE-Result: 10--7.877900-10.000000 X-TMASE-MatchedRID: DVl2cimgKao3i8FXueJ7nioiRKlBVkYI4Tk+Ydnj9Rsv82KK+I057r/E Sxz77lNODCNnb8CrvNq12HagvbwDji/7QU2czuUNA9lly13c/gFzq96Ia33704pLyz8UyqY4B4c sVfC2ODTckbaA+VOyo5fwx8YL6OA6IWERHkBDPUlBDn6Fjq77jpULM5ZpFgIpnhD4vcFcha4fJg 2kkQhA79l7+hrY7FlcVfvWvmVRqVkfE8yM4pjsDwtuKBGekqUpI/NGWt0UYPBrvr8rNiNXcHcq3 W4laNIfynMtAVgZr5kwbwhY13TvlEIb4fU9zdME X-TMASE-SNAP-Result: 1.821001.0001-0-1-22:0,33:0,34:0-0 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749640512034744732?= X-GMAIL-MSGID: =?utf-8?q?1749640512034744732?= This commit extends the RDMA user ABI to support the flush operation defined in IBA A19.4.1. These changes are backwards compatible with the existing RDMA user ABI. Reviewed-by: Zhu Yanjun Signed-off-by: Li Zhijian --- V5: new names and new patch split scheme, suggested by Bob --- include/uapi/rdma/ib_user_ioctl_verbs.h | 2 ++ include/uapi/rdma/ib_user_verbs.h | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/include/uapi/rdma/ib_user_ioctl_verbs.h b/include/uapi/rdma/ib_user_ioctl_verbs.h index 7dd56210226f..07b105e22f6f 100644 --- a/include/uapi/rdma/ib_user_ioctl_verbs.h +++ b/include/uapi/rdma/ib_user_ioctl_verbs.h @@ -57,6 +57,8 @@ enum ib_uverbs_access_flags { IB_UVERBS_ACCESS_ZERO_BASED = 1 << 5, IB_UVERBS_ACCESS_ON_DEMAND = 1 << 6, IB_UVERBS_ACCESS_HUGETLB = 1 << 7, + IB_UVERBS_ACCESS_FLUSH_GLOBAL = 1 << 8, + IB_UVERBS_ACCESS_FLUSH_PERSISTENT = 1 << 9, IB_UVERBS_ACCESS_RELAXED_ORDERING = IB_UVERBS_ACCESS_OPTIONAL_FIRST, IB_UVERBS_ACCESS_OPTIONAL_RANGE = diff --git a/include/uapi/rdma/ib_user_verbs.h b/include/uapi/rdma/ib_user_verbs.h index 43672cb1fd57..2d5f32d9d0d9 100644 --- a/include/uapi/rdma/ib_user_verbs.h +++ b/include/uapi/rdma/ib_user_verbs.h @@ -105,6 +105,18 @@ enum { IB_USER_VERBS_EX_CMD_MODIFY_CQ }; +/* see IBA A19.4.1.1 Placement Types */ +enum ib_placement_type { + IB_FLUSH_GLOBAL = 1U << 0, + IB_FLUSH_PERSISTENT = 1U << 1, +}; + +/* see IBA A19.4.1.2 Selectivity Level */ +enum ib_selectivity_level { + IB_FLUSH_RANGE = 0, + IB_FLUSH_MR, +}; + /* * Make sure that all structs defined in this file remain laid out so * that they pack the same way on 32-bit and 64-bit architectures (to @@ -466,6 +478,7 @@ enum ib_uverbs_wc_opcode { IB_UVERBS_WC_BIND_MW = 5, IB_UVERBS_WC_LOCAL_INV = 6, IB_UVERBS_WC_TSO = 7, + IB_UVERBS_WC_FLUSH = 8, }; struct ib_uverbs_wc { @@ -784,6 +797,7 @@ enum ib_uverbs_wr_opcode { IB_UVERBS_WR_RDMA_READ_WITH_INV = 11, IB_UVERBS_WR_MASKED_ATOMIC_CMP_AND_SWP = 12, IB_UVERBS_WR_MASKED_ATOMIC_FETCH_AND_ADD = 13, + IB_UVERBS_WR_FLUSH = 14, /* Review enum ib_wr_opcode before modifying this */ }; @@ -1331,6 +1345,8 @@ enum ib_uverbs_device_cap_flags { /* Deprecated. Please use IB_UVERBS_RAW_PACKET_CAP_SCATTER_FCS. */ IB_UVERBS_DEVICE_RAW_SCATTER_FCS = 1ULL << 34, IB_UVERBS_DEVICE_PCI_WRITE_END_PADDING = 1ULL << 36, + IB_UVERBS_DEVICE_FLUSH_GLOBAL = 1ULL << 38, + IB_UVERBS_DEVICE_FLUSH_PERSISTENT = 1ULL << 39, }; enum ib_uverbs_raw_packet_caps {