From patchwork Wed Jun 9 15:59:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yishai Hadas X-Patchwork-Id: 12310627 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 71F4FC48BCF for ; Wed, 9 Jun 2021 15:59:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5E9CF60FEB for ; Wed, 9 Jun 2021 15:59:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236463AbhFIQBv (ORCPT ); Wed, 9 Jun 2021 12:01:51 -0400 Received: from mail-dm6nam11on2052.outbound.protection.outlook.com ([40.107.223.52]:17953 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S234008AbhFIQBu (ORCPT ); Wed, 9 Jun 2021 12:01:50 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hN8G1lNNVqXE5aFFExwnV6DSz5bc7tMExz0miBVT+Z1Ne6qoWgHxj7W4LUTv3mvb6CIPvsZXCu9+6oFotPH2dDEUs7TXCDpbvHO68yTtVc9+VKAsF0Jh+2zILzZ9oCnlij3z0a+0Aar5c5SSoze038GAIQ2MojW3Z7AIzXFXwApl+01/VDKoYuZZWBMmm1YBVczlTZqREiYKKu4I00YBXDYOuShlmwh9X4ZeY8nlTXj29TkAabGOW1Gsk5nCz9VxcxYzrvKv+HxirNZ7x/1q+4+l/O8pauy2A3Xgq4dw17XJDQnQ4Fml3uPkg0ZwN7TJxO+e4H4TRwySmfpX/yZ7rA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SsuBq1nxnFReU05LeloaeknDCX2EzlPCjfCMhVT7hp0=; b=FI9JBhZpqBo1Q/TGs0cdbGru7XcZLi0vbvSH8lEiLlgaSjCylxgHfpbq6umbXuorQIihXGMBLNZzJGKY+JIBt3KJUoVlCpfLAjvStpVp5yFmpzU6lB8xBbQBWWhR+6/+kWRUD+v5d8tRwoyfgqqULPhmaZrLLE+FYuWUM0XIavYBn0kLOpXOostypCtMF1HVZi5Vhw9v34UJLLmTSYsnktttRXz7uJUjKxz45+vEwLYRh9yD/oQW6Cu3rqaJ4Clz5LNbW2JveZTyNEW7qVvtejfKHGW7fwV79BsVhqD/EN0c1j0hHDoQkAg1b+7nULm/DRzqURXXaSta57oxWrLrTQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SsuBq1nxnFReU05LeloaeknDCX2EzlPCjfCMhVT7hp0=; b=hNHLYyv2uQgpqFzkSdwMbjHd/eCL9dU0o78gA3aRmyz1Wnp48XzCcne/xOV7jqqK2wg+jzWUPwrPAnUW/KG9/F+qiHfk2zvudyx5DFwA6Qsz9ZWu1FUG2lEunu/YYvBbmoa8VJtCynm3Fwo9J7tmvqfFZpUsy0BuLBWspuJSvGP/ZqsPCpVuP+g7EJzcJj3NopDlyXe0e0ekvaDGXYNQiOyvG/5pXYDppaMHEv40HaLoAe2f1exsq57p4UJJQKAkPrz9eLzQcEttnZLMmQvW0q8geYyMJ8hZPinQG51RUBgg35c1pqHaEzwfYlRxhfZbTlvluJpe0nXTA2k2AQ2bqw== Received: from BN6PR14CA0038.namprd14.prod.outlook.com (2603:10b6:404:13f::24) by DM5PR12MB2486.namprd12.prod.outlook.com (2603:10b6:4:b2::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.20; Wed, 9 Jun 2021 15:59:54 +0000 Received: from BN8NAM11FT043.eop-nam11.prod.protection.outlook.com (2603:10b6:404:13f:cafe::b) by BN6PR14CA0038.outlook.office365.com (2603:10b6:404:13f::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.20 via Frontend Transport; Wed, 9 Jun 2021 15:59:54 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by BN8NAM11FT043.mail.protection.outlook.com (10.13.177.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4219.21 via Frontend Transport; Wed, 9 Jun 2021 15:59:54 +0000 Received: from HQMAIL107.nvidia.com (172.20.187.13) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 9 Jun 2021 15:59:53 +0000 Received: from vdi.nvidia.com (172.20.187.5) by mail.nvidia.com (172.20.187.13) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 9 Jun 2021 15:59:49 +0000 From: Yishai Hadas To: CC: , , , , Maor Gottlieb , Yishai Hadas Subject: [PATCH rdma-core 1/4] verbs: Introduce ibv_query_qp_data_in_order() verb Date: Wed, 9 Jun 2021 18:59:29 +0300 Message-ID: <20210609155932.218005-2-yishaih@nvidia.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210609155932.218005-1-yishaih@nvidia.com> References: <20210609155932.218005-1-yishaih@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3358bac4-b477-451d-0ed4-08d92b5f9f89 X-MS-TrafficTypeDiagnostic: DM5PR12MB2486: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4dSLCxc4SBAfbxHsyvqv4lcfTW/I98xdhu9jA65mk7GJsIQwbwmxxqBvpyNQb4AmJaTYw60FbyYXj8mWJJ2dqzo+wBjZsZ3h/BPudo0dtJm/00kJtfVpHhO4C+IDlYOydTeEAtXCYcXyZ4YlX4vp1iuZOZTXDJEdseDw4eAeyRp0tFhTLOPA6DITtrrq8DbwLvxJnkiVu/8snlX/0qoZBLc7hfkaKzARqNyjZyzvdorP7zVIB27tyw7pAMKsKUOYh+di2iXqu0XBDqPOfnEtN5/UobvA01XJD2nK6k06t8eTLA0vzp+wJtBhc3zec0HEnl+NwLDSkjodZkCsXDDZ/0li9tQytrbMa7mt53H+eV8Np3Q4mz8dRuIB2LxD//7kzXw7GaVUpOuP1Bame+QM3lp6Zi1ggJjNV+TfMP4SWXLT1OzE3T+zm3/sq57sjExEMn0erKzzarmv6B/vVE3Cx61cw1eSqG0LV+Os71Ij3h1LQSVmyTta4nOtMcr4bWJsdjEM5nba21P2XvuYhT98EkJkSpkN5DfsU8Qemy620eRPn638z5eOAZLp9i8H53xvXwU+7xkNaAypuFJT/tYhLLgp/YVRyB5rz8YlGCGVGV48dQFAvUbTlXoB1Wf9CaBU5i0r7biKXGlQrtvMmABHn24oby42rVcszm9DQvjku2k= X-Forefront-Antispam-Report: CIP:216.228.112.34;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:schybrid03.nvidia.com;CAT:NONE;SFS:(4636009)(39860400002)(396003)(136003)(376002)(346002)(36840700001)(46966006)(36906005)(86362001)(54906003)(316002)(7696005)(82310400003)(4001150100001)(5660300002)(186003)(8676002)(1076003)(6916009)(70586007)(70206006)(83380400001)(8936002)(26005)(36756003)(36860700001)(2616005)(336012)(478600001)(7636003)(6666004)(356005)(426003)(4326008)(82740400003)(47076005)(107886003)(2906002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2021 15:59:54.5034 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3358bac4-b477-451d-0ed4-08d92b5f9f89 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.112.34];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT043.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB2486 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Patrisious Haddad Introduce ibv_query_qp_data_in_order() verb, this enables an application to check whether the receiving data of the local QP is guaranteed to be in order for a given operation within its WQE. Once true, it allows user to poll for data instead of poll for completion. A detailed man page was added as well. Signed-off-by: Patrisious Haddad Reviewed-by: Maor Gottlieb Signed-off-by: Yishai Hadas --- debian/libibverbs1.symbols | 2 + libibverbs/CMakeLists.txt | 2 +- libibverbs/driver.h | 2 + libibverbs/dummy_ops.c | 8 ++++ libibverbs/libibverbs.map.in | 5 +++ libibverbs/man/CMakeLists.txt | 1 + libibverbs/man/ibv_query_qp_data_in_order.3.md | 62 ++++++++++++++++++++++++++ libibverbs/verbs.c | 6 +++ libibverbs/verbs.h | 14 ++++++ 9 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 libibverbs/man/ibv_query_qp_data_in_order.3.md diff --git a/debian/libibverbs1.symbols b/debian/libibverbs1.symbols index e7453b5..7b6bc8f 100644 --- a/debian/libibverbs1.symbols +++ b/debian/libibverbs1.symbols @@ -11,6 +11,7 @@ libibverbs.so.1 libibverbs1 #MINVER# IBVERBS_1.11@IBVERBS_1.11 32 IBVERBS_1.12@IBVERBS_1.12 34 IBVERBS_1.13@IBVERBS_1.13 35 + IBVERBS_1.14@IBVERBS_1.14 36 (symver)IBVERBS_PRIVATE_34 34 _ibv_query_gid_ex@IBVERBS_1.11 32 _ibv_query_gid_table@IBVERBS_1.11 32 @@ -98,6 +99,7 @@ libibverbs.so.1 libibverbs1 #MINVER# ibv_query_port@IBVERBS_1.1 1.1.6 ibv_query_qp@IBVERBS_1.0 1.1.6 ibv_query_qp@IBVERBS_1.1 1.1.6 + ibv_query_qp_data_in_order@IBVERBS_1.14 36 ibv_query_srq@IBVERBS_1.0 1.1.6 ibv_query_srq@IBVERBS_1.1 1.1.6 ibv_rate_to_mbps@IBVERBS_1.1 1.1.8 diff --git a/libibverbs/CMakeLists.txt b/libibverbs/CMakeLists.txt index 16df2c5..3c486b9 100644 --- a/libibverbs/CMakeLists.txt +++ b/libibverbs/CMakeLists.txt @@ -21,7 +21,7 @@ configure_file("libibverbs.map.in" rdma_library(ibverbs "${CMAKE_CURRENT_BINARY_DIR}/libibverbs.map" # See Documentation/versioning.md - 1 1.13.${PACKAGE_VERSION} + 1 1.14.${PACKAGE_VERSION} all_providers.c cmd.c cmd_ah.c diff --git a/libibverbs/driver.h b/libibverbs/driver.h index 926023b..8b2e045 100644 --- a/libibverbs/driver.h +++ b/libibverbs/driver.h @@ -370,6 +370,8 @@ struct verbs_context_ops { struct ibv_port_attr *port_attr); int (*query_qp)(struct ibv_qp *qp, struct ibv_qp_attr *attr, int attr_mask, struct ibv_qp_init_attr *init_attr); + int (*query_qp_data_in_order)(struct ibv_qp *qp, enum ibv_wr_opcode op, + uint32_t flags); int (*query_rt_values)(struct ibv_context *context, struct ibv_values_ex *values); int (*query_srq)(struct ibv_srq *srq, struct ibv_srq_attr *srq_attr); diff --git a/libibverbs/dummy_ops.c b/libibverbs/dummy_ops.c index 5ed67bf..bf70775 100644 --- a/libibverbs/dummy_ops.c +++ b/libibverbs/dummy_ops.c @@ -397,6 +397,12 @@ static int query_ece(struct ibv_qp *qp, struct ibv_ece *ece) return EOPNOTSUPP; } +static int query_qp_data_in_order(struct ibv_qp *qp, enum ibv_wr_opcode op, + uint32_t flags) +{ + return 0; +} + static int query_port(struct ibv_context *context, uint8_t port_num, struct ibv_port_attr *port_attr) { @@ -559,6 +565,7 @@ const struct verbs_context_ops verbs_dummy_ops = { query_ece, query_port, query_qp, + query_qp_data_in_order, query_rt_values, query_srq, read_counters, @@ -683,6 +690,7 @@ void verbs_set_ops(struct verbs_context *vctx, SET_PRIV_OP_IC(vctx, query_ece); SET_PRIV_OP_IC(ctx, query_port); SET_PRIV_OP(ctx, query_qp); + SET_PRIV_OP_IC(ctx, query_qp_data_in_order); SET_OP(vctx, query_rt_values); SET_OP(vctx, read_counters); SET_PRIV_OP(ctx, query_srq); diff --git a/libibverbs/libibverbs.map.in b/libibverbs/libibverbs.map.in index 7c0fb6a..0e39428 100644 --- a/libibverbs/libibverbs.map.in +++ b/libibverbs/libibverbs.map.in @@ -160,6 +160,11 @@ IBVERBS_1.13 { ibv_unimport_dm; } IBVERBS_1.12; +IBVERBS_1.14 { + global: + ibv_query_qp_data_in_order; +} IBVERBS_1.13; + /* If any symbols in this stanza change ABI then the entire staza gets a new symbol version. See the top level CMakeLists.txt for this setting. */ diff --git a/libibverbs/man/CMakeLists.txt b/libibverbs/man/CMakeLists.txt index 4d96e80..712a30f 100644 --- a/libibverbs/man/CMakeLists.txt +++ b/libibverbs/man/CMakeLists.txt @@ -64,6 +64,7 @@ rdma_man_pages( ibv_query_pkey.3.md ibv_query_port.3 ibv_query_qp.3 + ibv_query_qp_data_in_order.3.md ibv_query_rt_values_ex.3 ibv_query_srq.3 ibv_rate_to_mbps.3.md diff --git a/libibverbs/man/ibv_query_qp_data_in_order.3.md b/libibverbs/man/ibv_query_qp_data_in_order.3.md new file mode 100644 index 0000000..7558a92 --- /dev/null +++ b/libibverbs/man/ibv_query_qp_data_in_order.3.md @@ -0,0 +1,62 @@ +--- +date: 2020-3-3 +footer: libibverbs +header: "Libibverbs Programmer's Manual" +layout: page +license: 'Licensed under the OpenIB.org BSD license (FreeBSD Variant) - See COPYING.md' +section: 3 +title: ibv_query_qp_data_in_order +--- + +# NAME + +ibv_query_qp_data_in_order - check if qp data is guaranteed to be in order. + +# SYNOPSIS + +```c +#include + +int ibv_query_qp_data_in_order(struct ibv_qp *qp, enum ibv_wr_opcode op, uint32_t flags); + +``` + + +# DESCRIPTION + +**ibv_query_qp_data_in_order()** Checks whether WQE data is guaranteed to be +written in-order, and thus reader may poll for data instead of poll for completion. +This function indicates data is written in-order within each WQE, but cannot be used to determine ordering between separate WQEs. +This function describes ordering at the receiving side of the QP, not the sending side. + +# ARGUMENTS +*qp* +: The local queue pair (QP) to query. + +*op* +: The operation type to query about. Different operation types may write data in a different order. + For RDMA read operations: describes ordering of RDMA reads posted on this local QP. + For RDMA write operations: describes ordering of remote RDMA writes being done into this local QP. + For RDMA send operations: describes ordering of remote RDMA sends being done into this local QP. + This function should not be used to determine ordering of other operation types. + +*flags* +: Extra field for future input. For now must be 0. + +# RETURN VALUE + +**ibv_query_qp_data_in_order()** Returns 1 if the data is guaranteed to be written in-order, 0 otherwise. + +# NOTES + +Return value is valid only when the data is read by the CPU and relaxed ordering MR is not the target of the transfer. + +# SEE ALSO + +**ibv_query_qp**(3) + +# AUTHOR + +Patrisious Haddad + +Yochai Cohen diff --git a/libibverbs/verbs.c b/libibverbs/verbs.c index b2cba3f..19ff12f 100644 --- a/libibverbs/verbs.c +++ b/libibverbs/verbs.c @@ -684,6 +684,12 @@ LATEST_SYMVER_FUNC(ibv_query_qp, 1_1, "IBVERBS_1.1", return 0; } +int ibv_query_qp_data_in_order(struct ibv_qp *qp, enum ibv_wr_opcode op, + uint32_t flags) +{ + return get_ops(qp->context)->query_qp_data_in_order(qp, op, flags); +} + LATEST_SYMVER_FUNC(ibv_modify_qp, 1_1, "IBVERBS_1.1", int, struct ibv_qp *qp, struct ibv_qp_attr *attr, diff --git a/libibverbs/verbs.h b/libibverbs/verbs.h index 7d42095..3dd9a79 100644 --- a/libibverbs/verbs.h +++ b/libibverbs/verbs.h @@ -3148,6 +3148,20 @@ ibv_modify_qp_rate_limit(struct ibv_qp *qp, } /** + * ibv_query_qp_data_in_order - Checks whether the data is guaranteed to be + * written in-order. + * @qp: The QP to query. + * @op: Operation type. + * @flags: Extra field for future input. For now must be 0. + * + * Return Value + * ibv_query_qp_data_in_order() returns 1 if the data is guaranteed to be + * written in-order, 0 otherwise. + */ +int ibv_query_qp_data_in_order(struct ibv_qp *qp, enum ibv_wr_opcode op, + uint32_t flags); + +/** * ibv_query_qp - Returns the attribute list and current values for the * specified QP. * @qp: The QP to query. From patchwork Wed Jun 9 15:59:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yishai Hadas X-Patchwork-Id: 12310629 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D7E3C48BCF for ; Wed, 9 Jun 2021 16:00:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 43B416136D for ; Wed, 9 Jun 2021 16:00:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234008AbhFIQCA (ORCPT ); Wed, 9 Jun 2021 12:02:00 -0400 Received: from mail-bn8nam12on2081.outbound.protection.outlook.com ([40.107.237.81]:60608 "EHLO NAM12-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S237210AbhFIQB5 (ORCPT ); Wed, 9 Jun 2021 12:01:57 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iPp6Zpn13Mh6MsUExu9jeQl50dePRDy+UpgCS3WHcezLf764hwlsVqcnVhK4wAJrrFY3re6A0LytFddu2v1/FS1lzVibRdRiRSoizTwxWGwZfyA0MtWscaJHv4ccXQ61LYm8fzmhv+JaF/DAs2dw4V9ybIfxN04JqX3A7r3uNQrFF4+UVUe404WYpnKA7iYk2svSeQLLtqdSYCUPFC9m81eOwVfvsAwlsQC7xy4TJRxkUaR7gP0AZyqpRaG6H1j8nBFBjZWeU9NZ+f5U2C2+H0uJG3S5ITJyS8f82SrH+BBn3icgC0F/QRFQ1JG8LuKBOpKRbTAmUuYnsmmByBI/Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cuGtotfy1BrVIDKPnfEmFFRm4LkPgHSBeizo+fcTHDM=; b=mHS/fHKsACuueT6VE0f3FgmQegsSU/yqoEKxY3lveBqj8AWarHur7vob3ZSm2fybJBm9jomb2/uHwO2jGUqPiNCcIMaKXrM65/IYJQvY/ZeLNj+sW1CK3j+Z7vRdZpO+irqyf7UVqEIkANfj1D812UDmLeTXAhy1RzuKs7JIkD3k+ul77hGTlMFDO7vvhpaznCfElBGnuOz8JWhLOEN+EsfU3/WFZcMjMmx8lQxSgCCZiEwQy3v0IlKf0ZMBD8vZ2LqHMytS1Wfl2mBGXwne4fCwTn0jBD/V7jBsJp6K/JNVDejli0XGtWWeyE6wmsv3pbdqGSKk6vdkcXQYBiIx6A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.36) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cuGtotfy1BrVIDKPnfEmFFRm4LkPgHSBeizo+fcTHDM=; b=YfFDopYT+BqBAJ0IgpAFKMEd7dO5EIFQRwDQweZY2rBYkxYaWQj1PKkS2fVGk85bB6vVh+jrMy4t6OyXH+w8wlFeCIWdToY9OVKDjblUfyBA4w+UzYD4fBcFLhdt52NfqgW4XfuqOSF+BqMMfTO8Ae53BZvtJYuAwxPwxxrkkJSx2H0YyVkleqR95Uf8hB/4IFto4NSPYdrtXg0pfUboaabuHTP5vkhSsbdDVI9X740gXpcWOt68jNjMgHa1U3q9jo4XlOYtfhlbcHE59g34w/11sbDItPbH0gFYLblUMXE8LqBTz+oic2e6k42REEKqVeZ40YEMYJY7BrZsKwgQog== Received: from MW4PR03CA0336.namprd03.prod.outlook.com (2603:10b6:303:dc::11) by BL0PR12MB2419.namprd12.prod.outlook.com (2603:10b6:207:44::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.20; Wed, 9 Jun 2021 16:00:00 +0000 Received: from CO1NAM11FT004.eop-nam11.prod.protection.outlook.com (2603:10b6:303:dc:cafe::bf) by MW4PR03CA0336.outlook.office365.com (2603:10b6:303:dc::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.20 via Frontend Transport; Wed, 9 Jun 2021 16:00:00 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.36) smtp.mailfrom=nvidia.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.36 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.36; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.36) by CO1NAM11FT004.mail.protection.outlook.com (10.13.175.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4219.21 via Frontend Transport; Wed, 9 Jun 2021 16:00:00 +0000 Received: from HQMAIL107.nvidia.com (172.20.187.13) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 9 Jun 2021 15:59:59 +0000 Received: from vdi.nvidia.com (172.20.187.5) by mail.nvidia.com (172.20.187.13) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 9 Jun 2021 15:59:54 +0000 From: Yishai Hadas To: CC: , , , , Maor Gottlieb , Yishai Hadas Subject: [PATCH rdma-core 2/4] mlx5: Implement ibv_query_qp_data_in_order() verb Date: Wed, 9 Jun 2021 18:59:30 +0300 Message-ID: <20210609155932.218005-3-yishaih@nvidia.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210609155932.218005-1-yishaih@nvidia.com> References: <20210609155932.218005-1-yishaih@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a8a90bf9-3b6c-4794-77e3-08d92b5fa2ed X-MS-TrafficTypeDiagnostic: BL0PR12MB2419: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BClgm/y90Pgh2k1Ly99U9I1fzl9grUSHSnxFtzcoyL1jkdiKDylGwBltsYBzcovy+XsjIbart/ogmJ9/XFSLpsK+cw/pjSL4vwPnKdT0EiBUYn6tuka0pVw40cAb8oarfs+9y6wc4eMow2AeYb/s2U+Ew8zBluTXtmuSL7qZGZpk5lLmlSJHYZFHfnY7hfXodB0N8jhxKzcuVthOZaJfyvWhBcT27mc00Y5W95ishg0mEYN4aCkAEZ48yBtrBc/E7Vc4u04ZNvKGPd9rJdgxvyCilejJkhCMHzOmwshps8Ivr6mHmp9UcAO8OcmINmsQgaub6ocf5lZ5hEE+XE0AQlEGacKdk8L1jTlGKZaXBQqrkzCoBD3Ax8cwJCKQb2/MC4BIfrQinmc0XtzyuIvM5Qlx0EPAfykGSw70fL5RAEgMgMqOGAa9MZXvO+FFsT8Kwt8vxbdWcGOMpY12z+sAZXIR37zhnrnDiWORJtp6vo0u1bHRAfHP8wUuP7HcuYbtcZYuSl1UBNb1+ms6Vsl9KbRAwP16kJMO2DZnK2ixXIGB6pxnOG356tmHjxeyIJcCcWHqo0dUA5bNWYNVeFrsXh+aHbeSy0uL4X6rA7UGtiW6AR6hC5OYf7in8bKfQ0dVOMWTLfwuzzHwFSxAgjrA/9zMCQPdAph70KuYlsoOeNc= X-Forefront-Antispam-Report: CIP:216.228.112.36;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:schybrid05.nvidia.com;CAT:NONE;SFS:(4636009)(136003)(396003)(376002)(39860400002)(346002)(36840700001)(46966006)(8936002)(26005)(336012)(1076003)(82310400003)(426003)(2906002)(7696005)(5660300002)(54906003)(47076005)(36756003)(70206006)(186003)(70586007)(7636003)(356005)(82740400003)(107886003)(36906005)(6916009)(4326008)(36860700001)(2616005)(6666004)(83380400001)(8676002)(86362001)(478600001)(316002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2021 16:00:00.3875 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a8a90bf9-3b6c-4794-77e3-08d92b5fa2ed X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.112.36];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT004.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR12MB2419 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Patrisious Haddad Implement the ibv_query_qp_data_in_order() verb by using DEVX to read from firmware the 'in_order_data' capability. Signed-off-by: Patrisious Haddad Reviewed-by: Maor Gottlieb Signed-off-by: Yishai Hadas --- providers/mlx5/mlx5.c | 1 + providers/mlx5/mlx5.h | 3 +++ providers/mlx5/mlx5_ifc.h | 39 +++++++++++++++++++++++++++++++-- providers/mlx5/verbs.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 96 insertions(+), 2 deletions(-) diff --git a/providers/mlx5/mlx5.c b/providers/mlx5/mlx5.c index 8ef305e..75ffde9 100644 --- a/providers/mlx5/mlx5.c +++ b/providers/mlx5/mlx5.c @@ -167,6 +167,7 @@ static const struct verbs_context_ops mlx5_ctx_common_ops = { .unimport_dm = mlx5_unimport_dm, .unimport_mr = mlx5_unimport_mr, .unimport_pd = mlx5_unimport_pd, + .query_qp_data_in_order = mlx5_query_qp_data_in_order, }; static const struct verbs_context_ops mlx5_ctx_cqev1_ops = { diff --git a/providers/mlx5/mlx5.h b/providers/mlx5/mlx5.h index f6c74df..bfa66ab 100644 --- a/providers/mlx5/mlx5.h +++ b/providers/mlx5/mlx5.h @@ -398,6 +398,7 @@ struct mlx5_context { struct mlx5_bf *nc_uar; void *cq_uar_reg; struct mlx5_reserved_qpns reserved_qpns; + uint8_t qp_data_in_order_cap:1; }; struct mlx5_bitmap { @@ -1088,6 +1089,8 @@ struct ibv_qp *mlx5_create_qp(struct ibv_pd *pd, struct ibv_qp_init_attr *attr); int mlx5_query_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr, int attr_mask, struct ibv_qp_init_attr *init_attr); +int mlx5_query_qp_data_in_order(struct ibv_qp *qp, enum ibv_wr_opcode op, + uint32_t flags); int mlx5_modify_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr, int attr_mask); int mlx5_modify_qp_rate_limit(struct ibv_qp *qp, diff --git a/providers/mlx5/mlx5_ifc.h b/providers/mlx5/mlx5_ifc.h index 35be5ba..302788f 100644 --- a/providers/mlx5/mlx5_ifc.h +++ b/providers/mlx5/mlx5_ifc.h @@ -51,6 +51,7 @@ enum { MLX5_CMD_OP_INIT2INIT_QP = 0x50e, MLX5_CMD_OP_CREATE_PSV = 0x600, MLX5_CMD_OP_DESTROY_PSV = 0x601, + MLX5_CMD_OP_QUERY_DCT = 0x713, MLX5_CMD_OP_QUERY_ESW_VPORT_CONTEXT = 0x752, MLX5_CMD_OP_QUERY_NIC_VPORT_CONTEXT = 0x754, MLX5_CMD_OP_QUERY_ROCE_ADDRESS = 0x760, @@ -641,7 +642,11 @@ struct mlx5_ifc_cmd_hca_cap_bits { u8 reserved_at_21[0xf]; u8 vhca_id[0x10]; - u8 reserved_at_40[0x40]; + u8 reserved_at_40[0x20]; + + u8 reserved_at_60[0x2]; + u8 qp_data_in_order[0x1]; + u8 reserved_at_63[0x1d]; u8 log_max_srq_sz[0x8]; u8 log_max_qp_sz[0x8]; @@ -2654,6 +2659,12 @@ enum { MLX5_ACTION_IN_FIELD_OUT_GTPU_TEID = 0x6E, }; +struct mlx5_ifc_dctc_bits { + u8 reserved_at_0[0x1d]; + u8 data_in_order[0x1]; + u8 reserved_at_1e[0x362]; +}; + struct mlx5_ifc_packet_reformat_context_in_bits { u8 reserved_at_0[0x5]; u8 reformat_type[0x3]; @@ -3040,7 +3051,7 @@ struct mlx5_ifc_qpc_bits { u8 log_sq_size[0x4]; u8 reserved_at_55[0x3]; u8 ts_format[0x2]; - u8 reserved_at_5a[0x1]; + u8 data_in_order[0x1]; u8 rlky[0x1]; u8 ulp_stateless_offload_mode[0x4]; @@ -3409,6 +3420,30 @@ struct mlx5_ifc_query_qp_in_bits { u8 reserved_at_60[0x20]; }; +struct mlx5_ifc_query_dct_out_bits { + u8 status[0x8]; + u8 reserved_at_8[0x18]; + + u8 syndrome[0x20]; + + u8 reserved_at_40[0x40]; + + struct mlx5_ifc_dctc_bits dctc; +}; + +struct mlx5_ifc_query_dct_in_bits { + u8 opcode[0x10]; + u8 reserved_at_10[0x10]; + + u8 reserved_at_20[0x10]; + u8 op_mod[0x10]; + + u8 reserved_at_40[0x8]; + u8 dctn[0x18]; + + u8 reserved_at_60[0x20]; +}; + struct mlx5_ifc_tisc_bits { u8 strict_lag_tx_port_affinity[0x1]; u8 tls_en[0x1]; diff --git a/providers/mlx5/verbs.c b/providers/mlx5/verbs.c index 8fcef62..88f4c3c 100644 --- a/providers/mlx5/verbs.c +++ b/providers/mlx5/verbs.c @@ -2674,6 +2674,57 @@ free: return 0; } +static int query_dct_in_order(struct ibv_qp *qp) +{ + uint32_t in_dct[DEVX_ST_SZ_DW(query_dct_in)] = {}; + uint32_t out_dct[DEVX_ST_SZ_DW(query_dct_out)] = {}; + int ret; + + DEVX_SET(query_dct_in, in_dct, opcode, MLX5_CMD_OP_QUERY_DCT); + DEVX_SET(query_dct_in, in_dct, dctn, qp->qp_num); + ret = mlx5dv_devx_qp_query(qp, in_dct, sizeof(in_dct), out_dct, + sizeof(out_dct)); + if (ret) + return 0; + + return DEVX_GET(query_dct_out, out_dct, dctc.data_in_order); +} + +int mlx5_query_qp_data_in_order(struct ibv_qp *qp, enum ibv_wr_opcode op, + uint32_t flags) +{ + uint32_t in_qp[DEVX_ST_SZ_DW(query_qp_in)] = {}; + uint32_t out_qp[DEVX_ST_SZ_DW(query_qp_out)] = {}; + struct mlx5_context *mctx = to_mctx(qp->context); + struct mlx5_qp *mqp = to_mqp(qp); + int ret; + +/* Currently this API is only supported for x86 architectures since most + * non-x86 platforms are known to be OOO and need to do a per-platform study. + */ +#if !defined(__i386__) && !defined(__x86_64__) + return 0; +#endif + + if (flags || !mctx->qp_data_in_order_cap) + return 0; + + if (mqp->dc_type == MLX5DV_DCTYPE_DCT) + return query_dct_in_order(qp); + + if (qp->state != IBV_QPS_RTS) + return 0; + + DEVX_SET(query_qp_in, in_qp, opcode, MLX5_CMD_OP_QUERY_QP); + DEVX_SET(query_qp_in, in_qp, qpn, qp->qp_num); + ret = mlx5dv_devx_qp_query(qp, in_qp, sizeof(in_qp), out_qp, + sizeof(out_qp)); + if (ret) + return 0; + + return DEVX_GET(query_qp_out, out_qp, qpc.data_in_order); +} + int mlx5_query_qp(struct ibv_qp *ibqp, struct ibv_qp_attr *attr, int attr_mask, struct ibv_qp_init_attr *init_attr) { @@ -3584,6 +3635,10 @@ static void get_hca_general_caps(struct mlx5_context *mctx) if (ret) return; + mctx->qp_data_in_order_cap = + DEVX_GET(query_hca_cap_out, out, + capability.cmd_hca_cap.qp_data_in_order); + mctx->entropy_caps.num_lag_ports = DEVX_GET(query_hca_cap_out, out, capability.cmd_hca_cap.num_lag_ports); From patchwork Wed Jun 9 15:59:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yishai Hadas X-Patchwork-Id: 12310631 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9AA9C48BCD for ; Wed, 9 Jun 2021 16:00:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BB4A560FEB for ; Wed, 9 Jun 2021 16:00:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232146AbhFIQCQ (ORCPT ); Wed, 9 Jun 2021 12:02:16 -0400 Received: from mail-co1nam11on2087.outbound.protection.outlook.com ([40.107.220.87]:1408 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231783AbhFIQCP (ORCPT ); Wed, 9 Jun 2021 12:02:15 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bx0W3GG9FDq6FqSFtmRl4kpL1g6yXeS01ji/Gl+FkmE5lekDRKbSZxGOv0yyzv5uDzLsHA6+emr/K86FjQjex8HuMIQ33v+iEtCzTBvXY8jyxUeGUUM25EeifCUFYP2KEClrJ8nNS6so5xPvPdCUnG1GLuVvhHzX0ciS2i0B93DB8SN4CZ/vkfdu3Om82+AQUZq2FiQW/rMfL9G+dOBoHBKWiP3qAjRNbhook5JZRpKpWjXXAy/SRTcwsTANwYkwW8PzrpY9fAQji9cd+k0MONgI3x+Uuvbe6FxyVYzxEk/phu04Ojg0t9IaPiD7cTwUqyKGEmy7KuWW1m0ChCKe2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Se7Q0SBi1s6qk1jefm+deevKBOB2zSwx8mK6A+4bnrs=; b=l+7aHWShWMDJJQM3ExAdUwNjitwcAmeRAPXVG2mwobhYFMcUKaaba8i/iyRR53cgqjOJEgxsaz9C4USqoUTcJRdr+nYXJ7t6Y/d3cEA3bD/nSJdmuNJG/T/qrZ29b3rXbMnVQ+EK/h7KUDAn8jDMDTuztSAa70SCLAUAtYysyT3dMpLxo4UOx9rHU4qFOQ3aiiNKCqnHjLUwM3P+4DMYWQj8D4vVgPT56PBSdeJ3vleg+Oiblg2ecPTceGLb4PAKtmcYXB2M2M/9J7BzHz2PUkSaWm98wcrWfmoAp3kABcWco8k2yr5NvcOdbkJv9HbBlLbT751gzRwe77DYE/MlGA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.35) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Se7Q0SBi1s6qk1jefm+deevKBOB2zSwx8mK6A+4bnrs=; b=bc3sDguM12PafeQcutVloHPAUxx4gKaFXudu11NukwN9NwC4o1ppN/VJJKB7QAbP1jjAxZ8YooP9XXc5GHvFE/EKrCywwI/v19UBkmnJF+2aw0l6MQSCIpM4fwcKCf4Fg75FzTCZvIQcu14z76KlYwO26YHfdoyPB0axzocBA2ZiJn0jVK531FOeNV2ll+EHZhdMbu+77jP+yOQt08ya+Z7+0skvyt0sz10XJj1vG2Hsd5kreQkSoLfEZ1oYwNLkYdYm0xWeyfEqbeA7TN/KZd8OxzqneUduhMu8DXkcsfnF1hDOH5CG2skw/E20ivMSay3nMQiDSulsmC3H9OGc4Q== Received: from MW4P220CA0025.NAMP220.PROD.OUTLOOK.COM (2603:10b6:303:115::30) by BL0PR12MB4755.namprd12.prod.outlook.com (2603:10b6:208:82::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.22; Wed, 9 Jun 2021 16:00:19 +0000 Received: from CO1NAM11FT054.eop-nam11.prod.protection.outlook.com (2603:10b6:303:115:cafe::ff) by MW4P220CA0025.outlook.office365.com (2603:10b6:303:115::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.21 via Frontend Transport; Wed, 9 Jun 2021 16:00:19 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.35) smtp.mailfrom=nvidia.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.35 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.35; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.35) by CO1NAM11FT054.mail.protection.outlook.com (10.13.174.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4219.21 via Frontend Transport; Wed, 9 Jun 2021 16:00:19 +0000 Received: from HQMAIL107.nvidia.com (172.20.187.13) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 9 Jun 2021 16:00:06 +0000 Received: from vdi.nvidia.com (172.20.187.5) by mail.nvidia.com (172.20.187.13) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 9 Jun 2021 16:00:01 +0000 From: Yishai Hadas To: CC: , , , , Shachar Kagan , Ido Kalir , Edward Srouji Subject: [PATCH rdma-core 3/4] pyverbs: Add query QP data in order support Date: Wed, 9 Jun 2021 18:59:31 +0300 Message-ID: <20210609155932.218005-4-yishaih@nvidia.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210609155932.218005-1-yishaih@nvidia.com> References: <20210609155932.218005-1-yishaih@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e5ab2637-4126-4788-bb6a-08d92b5fae20 X-MS-TrafficTypeDiagnostic: BL0PR12MB4755: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vVH4cgpxfmyABpj/l9pRQMl7AcoxBNs5YwBr+N902gk2NTrVSOONz068xlqFCGUdaHceEQEpxiD0QgJjoIXZxFUdObuV7OORh5+me1gG4u1RS/tzMVI+CAFhMgEMbSiQBrPgcWnjtGxUgKYMv3vbFsfadKe8gftpK1mVcdoQ6RwgAEjsUv4LgMxNjBNiO9UgKUMDi4Z1MJh0rKBH/zn8wDGKAbg2H0H+QEoG9OiIFT9+YqNE1kq/zBQUvORB77Ra8fi6NGGosIvzPpCJ9NGL58QL7O0/Y3Y9GYbqaCyICWXHWfzLqtsh8xHYPXE0IXkuaO7dSbQNkBt9U5TTtS/P83AFXXWTFVL/GZPy9DSE1PKX31HDG4e5cJSeA8N4iMv8a3d2QpBe+5p4rHBFHSjIGrDH7CV17T1sEGsVPE6vTm4tgp6/FmDtpzV2r538UFSE2uBU0CxDbZuucuMzyH+3tyc1iK5eY2APfFS6fWCmHf+Y6UJ/OcIagYhCHXKwMqhNqmtX+NSTlLKrn4HkHuKw4WaQ21kOAdAlJPoF98tAn1JG/YvGztVlJMDzpwgd9OR9XqMIAQ/d5ojZrc8eANW8iWV1ui1EU2aANj81l2+oYWp9G2Gqo4ywvITJ6qt+cbZz6X+LFikZrwpX6CS5+mkxX0EqF46x2vYwfn9avV13s1U= X-Forefront-Antispam-Report: CIP:216.228.112.35;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:schybrid02.nvidia.com;CAT:NONE;SFS:(4636009)(136003)(396003)(376002)(39860400002)(346002)(46966006)(36840700001)(2616005)(8676002)(478600001)(7636003)(36756003)(426003)(336012)(6666004)(107886003)(36860700001)(2906002)(26005)(82740400003)(4326008)(356005)(82310400003)(47076005)(7696005)(5660300002)(86362001)(54906003)(36906005)(316002)(70206006)(70586007)(8936002)(83380400001)(186003)(6916009)(1076003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2021 16:00:19.1744 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e5ab2637-4126-4788-bb6a-08d92b5fae20 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.112.35];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT054.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR12MB4755 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Shachar Kagan Add the ability to check if QP data is guaranteed to be in order. Signed-off-by: Shachar Kagan Reviewed-by: Ido Kalir Signed-off-by: Edward Srouji --- pyverbs/libibverbs.pxd | 1 + pyverbs/qp.pyx | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/pyverbs/libibverbs.pxd b/pyverbs/libibverbs.pxd index 35e47aa..4c84c18 100644 --- a/pyverbs/libibverbs.pxd +++ b/pyverbs/libibverbs.pxd @@ -723,6 +723,7 @@ cdef extern from 'infiniband/verbs.h': int ibv_query_rt_values_ex(ibv_context *context, ibv_values_ex *values) int ibv_get_async_event(ibv_context *context, ibv_async_event *event) void ibv_ack_async_event(ibv_async_event *event) + int ibv_query_qp_data_in_order(ibv_qp *qp, ibv_wr_opcode op, uint32_t flags) cdef extern from 'infiniband/driver.h': diff --git a/pyverbs/qp.pyx b/pyverbs/qp.pyx index 0b117df..88516f8 100644 --- a/pyverbs/qp.pyx +++ b/pyverbs/qp.pyx @@ -1229,6 +1229,15 @@ cdef class QP(PyverbsCM): if rc != 0: raise PyverbsRDMAError('Failed to Bind MW', rc) + def query_data_in_order(self, op, flags=0): + """ + Query if QP data is guaranteed to be in order. + :param op: Operation type. + :param flags: Extra field for future input. For now must be 0. + :return: 1 in case the data is guaranteed to be in order, 0 otherwise. + """ + return v.ibv_query_qp_data_in_order(self.qp, op, flags) + @property def qp_type(self): return self.qp.qp_type From patchwork Wed Jun 9 15:59:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yishai Hadas X-Patchwork-Id: 12310633 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4398C48BCF for ; Wed, 9 Jun 2021 16:00:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C75F861377 for ; Wed, 9 Jun 2021 16:00:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231783AbhFIQCS (ORCPT ); Wed, 9 Jun 2021 12:02:18 -0400 Received: from mail-mw2nam12on2072.outbound.protection.outlook.com ([40.107.244.72]:36896 "EHLO NAM12-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232332AbhFIQCS (ORCPT ); Wed, 9 Jun 2021 12:02:18 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cYETS1gdm/7U4oqhQD3RHywyS7uzjs7dW4w2txQloapwigUwv0fsFkKX09Vr06+ayZfjGCTg2ZtDmEwyx+6pZXWmKNmAOWi5eZth9QUciokwwd22NmEWLP011OS68Y8nueCgMhhYmSIteLKrnsBKf6exnJki4Pu+lE+L84enrDIMcqyGX7Neop8OjBFGq6tNlFONU+sLidoPXWW+w12sSE4D1s4eujQoib1mVIoo0ri589MWaIN4kqlgfxvqfNN07x7hQDqVG7kflkUnRXUIe3XTFxQ43eCUFfLVHuusbY7KDswNy3plTTRO3q833MHKKHINad4Zc3x5LHkiW+sE5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cxQ/sEFt09N32kFATYtl+p86AkR/pHHuMTQB869t9ZU=; b=gES0jgjTmwB9YHCR9Nvobu42qyP7QfRoKEyx616usIKx56JwkWZ8SaMVRPKYafcnu8HXLkdjohkmwxcWq71nFn+6gG1aLWsqUDRh8Ll3hM5Ogr4WunlQRt4usIWcjkuJwUUaSffjPbpPLH3xWvNa56OPxWDO+iXL3dA+nXDGaqHrG/GzpmpmHh2soNGdyQNtvQQKpYvB+++OkyytYcLRF8aOI9L1iD6i8mjH2ALebN8Vd1Kb2XqeTABCGyOk5Td09nzTgPCZF/Z4R+9SjKiIpoAfTahTeXzR4xtdyAknvKN9pyXMCa4hPPvlbfz6HL89660wlv46Erx9k7G/fnQ7Wg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.35) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cxQ/sEFt09N32kFATYtl+p86AkR/pHHuMTQB869t9ZU=; b=L2uX5rBK4X/xBG7q17BubKmOIfS7+9CSPx0IDXrG+OCiKM7Xtv9A2HBJrjVfC394YoshsNwVoxhfEhQelWmoAQF+NafHHxQbmC2BpJUQS64XzfamaUDzFRA8H85YYReNaVdO+aeo5ET6kUolb5WUflnrenhphBKllazFhUHNNUzG24pYZHvPkrJoYwmH2F8pWOc4RwaqaZ41pfkV8ox+9413QGG3+DvAtJXQi2n/P7NEHAbMxkkZiJy7y76KEO1fpwLk/8ZgULfizBvY793d9zQ61Em6eQCYdiMwG8M3rM8rdweZzDa3BroC6PAMb5SGkleYTpjAc/yjgM2lfEOVwA== Received: from MW4PR04CA0175.namprd04.prod.outlook.com (2603:10b6:303:85::30) by MN2PR12MB3391.namprd12.prod.outlook.com (2603:10b6:208:c3::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.21; Wed, 9 Jun 2021 16:00:22 +0000 Received: from CO1NAM11FT051.eop-nam11.prod.protection.outlook.com (2603:10b6:303:85:cafe::66) by MW4PR04CA0175.outlook.office365.com (2603:10b6:303:85::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.20 via Frontend Transport; Wed, 9 Jun 2021 16:00:22 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.35) smtp.mailfrom=nvidia.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.35 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.35; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.35) by CO1NAM11FT051.mail.protection.outlook.com (10.13.174.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4219.21 via Frontend Transport; Wed, 9 Jun 2021 16:00:22 +0000 Received: from HQMAIL107.nvidia.com (172.20.187.13) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 9 Jun 2021 16:00:11 +0000 Received: from vdi.nvidia.com (172.20.187.5) by mail.nvidia.com (172.20.187.13) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 9 Jun 2021 16:00:07 +0000 From: Yishai Hadas To: CC: , , , , Shachar Kagan , Ido Kalir , Edward Srouji Subject: [PATCH rdma-core 4/4] tests: Add query QP data in order coverage Date: Wed, 9 Jun 2021 18:59:32 +0300 Message-ID: <20210609155932.218005-5-yishaih@nvidia.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210609155932.218005-1-yishaih@nvidia.com> References: <20210609155932.218005-1-yishaih@nvidia.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 46c9d322-289b-4c86-9581-08d92b5faff7 X-MS-TrafficTypeDiagnostic: MN2PR12MB3391: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1c8HA7duWwq0gYS8OY6+pxoJCXqRAo0aEmabyXlao01rXIuJub8ftJmA09YhVD9QFmDQQkdmTNQbbpaNKfx6VdU/NY3NdSW2olEEbfJNAsEmfAE4X2k/tnMV0JfpL7BdOZRVMiH7N3k+GgTeQ+L41v4Uslowx2elpgmv0niGrCISzUIHTgePSYzWr1wuIgXao5tzyoMZD8BQblk9M+TExoyQ4nI4fCy2l1zD9GfdJuPOXn/349V6r6Q0HjuuA5SxKj3BmGxLlSVwZi0ksh6NBDItp4HM4hYWcDzwv1Jcbh1rA1pmELwTio/MwHys5juN+P8pINHSGjiw2Oe5hQvMrGOywCJjFThCsmUBHPvmidB9znGIj/kFzbaQkljB7V6duApA/xVYyATgiZiLMgVKVguGSc72DiEU3nlE6nvTk4aysR25NjsRbwpvys99EI7v4Xub2JoAJe5p/kXxa3Jud+CFODRbjCPkTq7nLvjBBT/GyyJ1XqcJrOl1IyfIalrbS1Dxf2+uU8tciknExz9/4KCWR4cfPpdyFrtst0Swglj4znC6I4TjiKyJ5WgtwTGgvQBj9UrRi9Iko/WS3gH2Eb8TpP7JDOk2Zud3oiEma7HTYqQ+Twl4tY0O1GCUhRwTV2MwV9GVD5/f3Tywo5yjAm3uq/Zx5jDR2rtRvu/MbP0= X-Forefront-Antispam-Report: CIP:216.228.112.35;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:schybrid02.nvidia.com;CAT:NONE;SFS:(4636009)(39860400002)(346002)(376002)(396003)(136003)(46966006)(36840700001)(316002)(2906002)(6666004)(54906003)(86362001)(7696005)(82310400003)(478600001)(5660300002)(47076005)(36756003)(1076003)(36860700001)(7636003)(356005)(70586007)(36906005)(336012)(8936002)(26005)(186003)(6916009)(8676002)(82740400003)(4326008)(426003)(83380400001)(2616005)(107886003)(70206006);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2021 16:00:22.2812 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 46c9d322-289b-4c86-9581-08d92b5faff7 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.112.35];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT051.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3391 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Shachar Kagan Add a test which queries a QP in RTS state and check if data is guaranteed to be in order. Signed-off-by: Shachar Kagan Reviewed-by: Ido Kalir Signed-off-by: Edward Srouji --- tests/test_qp.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/test_qp.py b/tests/test_qp.py index 53b1d32..a623cb3 100644 --- a/tests/test_qp.py +++ b/tests/test_qp.py @@ -228,6 +228,19 @@ class QPTest(PyverbsAPITestCase): """ self.query_qp_common_test(e.IBV_QPT_RAW_PACKET) + def test_query_data_in_order(self): + """ + Queries an UD QP data in order after moving it to RTS state. + Verifies that the result from the query is valid. + """ + with PD(self.ctx) as pd: + with CQ(self.ctx, 100, None, None, 0) as cq: + qia = u.get_qp_init_attr(cq, self.attr) + qia.qp_type = e.IBV_QPT_UD + qp = self.create_qp(pd, qia, False, True, self.ib_port) + is_data_in_order = qp.query_data_in_order(e.IBV_WR_SEND) + self.assertIn(is_data_in_order, [0, 1], 'Data in order result is not valid') + def test_modify_ud_qp(self): """ Queries a UD QP after calling modify(). Verifies that its properties are