From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 63AA642D09; Tue, 20 Jun 2023 16:12:42 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4645C42D61; Tue, 20 Jun 2023 16:12:10 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by mails.dpdk.org (Postfix) with ESMTP id E9FD342D51 for ; Tue, 20 Jun 2023 16:12:07 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SKy4LUdsnl2iwhYlLxSOjqpEhdX8YE9r9lrPGXW6PmVzF2fhr9BxLeUmtoXyRlBPUieWyj5DSQ7ucEd+0JWtBAwxCvF8QQs5e9PaHdDodngCLlxhdhAiAosnAf7LOflglIqVMe9L9B/T9l7iYpOhhk+Wnj/rmcr6PGbpZlYKFQdncWJMsaw7I4XL/yGetVsmZqlD4x47MPj56Zj5GQmMqDJb6O7yJJ+qSMhWy5kqIT5+yibOPsdehxtMqlwq1jsFWJ/+uCFy6E9QXpWSOs+YZzaQul1vYZUMtZAtG8b8DuqIIDmcs6SLg9JsI1HNGRvl2D+5tsaRdjN71eQsvLyuPw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=NNYtI2pmopv51C/fsgPEn/KcG1IwmPtSJ9gqoVHZ1k8=; b=LzQP7VVeqAJHbgyXw5oIAQK+9GAHWVSx5jVokcu/i/f/W8f9sAEePRiwO9YuWjbDAVLeB6fnca8x+tR82dlk0HfmW+dFwhMBHOYucWXSEANWUWryVB4hfEo8uXEtwhVKhsDmCn3gRRhJV5jFW2hUEt9iuMSQr7ancvUjI+WzN7pVL1sSsvaelgtN21ESoIElmDAHfLp/iG/K90pjvFzfC1NmfBFz9x4HQQO7gb6P9eu7yoEEr5hles9tu/FbtMao9vHyQ0a8Cis3VN2gLR0qSLxTmWhpZiaHAlPxaPZnDGPmFf44aZQSsfw0ghf+rztqEioG3w7gmhDsHKT5wlfjoA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=marvell.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject 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=NNYtI2pmopv51C/fsgPEn/KcG1IwmPtSJ9gqoVHZ1k8=; b=CMhrDfo6oMXtG2tJcW+6HopNlvHaJJOmAv/YjFfz+CyI1VsL/5BQXPmbEBubtTGi9k5WqON5ndmm9ZzsM+Ctn5zeyxQa3C+42ZKiz44GgUZ8v7msCSP1kmvmyLbOTnv/ZqaFBj8QkIggIom4AaJFgBLwHFZnhS9BaXC9ol0IJUT80sJn9CRJgAsjWSiM7teGBC787v8IWwDQXY3bDxevbzsq0Aq+A1Pjk2eFne5KAI+ooWX7u9F5/yzNI+UMG66bzqsV3/UOW9xdpNXHqE2lhArXeSVvb0sU/SFNqBMTlFGAPNOInv7syGhqJH9WpbPmD3Ipl5Ms5glIJzU0vJ33mg== Received: from DM6PR02CA0117.namprd02.prod.outlook.com (2603:10b6:5:1b4::19) by IA1PR12MB8224.namprd12.prod.outlook.com (2603:10b6:208:3f9::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.37; Tue, 20 Jun 2023 14:12:06 +0000 Received: from CY4PEPF0000EE3F.namprd03.prod.outlook.com (2603:10b6:5:1b4:cafe::59) by DM6PR02CA0117.outlook.office365.com (2603:10b6:5:1b4::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.21 via Frontend Transport; Tue, 20 Jun 2023 14:12:04 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CY4PEPF0000EE3F.mail.protection.outlook.com (10.167.242.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.19 via Frontend Transport; Tue, 20 Jun 2023 14:12:05 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Tue, 20 Jun 2023 07:11:49 -0700 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 20 Jun 2023 07:11:47 -0700 From: Suanming Mou To: , Matan Azrad , Viacheslav Ovsiienko , Ori Kam CC: , Subject: [PATCH v4 6/9] common/mlx5: add WQE-based QP synchronous basics Date: Tue, 20 Jun 2023 17:11:12 +0300 Message-ID: <20230620141115.841226-7-suanmingm@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230620141115.841226-1-suanmingm@nvidia.com> References: <20230418092325.2578712-1-suanmingm@nvidia.com> <20230620141115.841226-1-suanmingm@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE3F:EE_|IA1PR12MB8224:EE_ X-MS-Office365-Filtering-Correlation-Id: dbdfe287-7902-4494-400c-08db719853f6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1c6ZHvxAWc14LpzySrMzIDgTuIBO1keOTiHhkOWB49zW03rmTEHSA4ygEqSS3mQg9ZUN0BqU58zD2lzUgCBTBhE8V6xzR7NNPB9LHkyitt7EfelO5bNlUBnTdHjKkorWe9vIKsjeKEOX9Jlek579nXaF7gPSTkpDbxCw+k6JbclMpEOufdTk3HSnkZ7s3MxsPK+BUbNA8ghMkrWBLu90RQwVDF14di/Vgz9e+EpPHLkxSk3Ggy/iuOzrEaLMgJ+rHMzaQcHflUt317SJe611C+bo/lP2xk4furTST/mr/kAjCF9cjwTt+mHuxzV/T2uQqUiqLB+E03NUVcuIZNcKwDG2CE/L49bK3BH2/enNf22q1yC3iW3NFnq+hrQdOyiP66owPxq/b2YN3rWrO2yJhX504Hkp5ZWfiVyDOt8tLcE64ojorGOfZppMYGNDtPnCc2JrWu5pr1r24Fv7bzH6juD74ylnmpMKY3ndgEDU/ios85XNq1f845y9WHJZK8K8sK/6o/LW2ckCb/r7/MNEnyMsczO/odUvExtyw2oYsKGnT5eI1a18mdSv+Rg6Pdi1z9KfVSbul0hICnmPOjHU1Razx0xxURIGLaDKa6SiOffE3Mkp4/tyC+JxT6VlDUMfehhmFEM2CtN6Fzwdgt91Cd2OL3G1153YrW7Ff6Xn4W7j/H2xqJVRGs7tBPVWh+rJ/tC1xyQyLfZ1zgtysGoKAvzQlkq5BP6/5F9hHovos04= X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230028)(4636009)(376002)(39860400002)(396003)(346002)(136003)(451199021)(36840700001)(40470700004)(46966006)(110136005)(186003)(54906003)(6286002)(16526019)(7696005)(6666004)(86362001)(26005)(1076003)(478600001)(2616005)(336012)(426003)(316002)(82740400003)(70586007)(70206006)(356005)(6636002)(4326008)(7636003)(36860700001)(47076005)(41300700001)(5660300002)(40460700003)(2906002)(55016003)(40480700001)(36756003)(82310400005)(8936002)(8676002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2023 14:12:05.9578 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dbdfe287-7902-4494-400c-08db719853f6 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000EE3F.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB8224 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Nvidia HW provides a synchronous mechanism between QPs. When creating the QPs, user can set one as primary and another as follower. The follower QP's WQE execution can be controlled by primary QP via SEND_EN WQE. This commit introduces the SEND_EN WQE to improve the WQE execution sync-up between primary and follower QPs. Signed-off-by: Suanming Mou Acked-by: Matan Azrad --- drivers/common/mlx5/mlx5_devx_cmds.c | 6 ++++++ drivers/common/mlx5/mlx5_devx_cmds.h | 3 +++ drivers/common/mlx5/mlx5_prm.h | 11 +++++++++++ 3 files changed, 20 insertions(+) diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c b/drivers/common/mlx5/mlx5_devx_cmds.c index 4332081165..ef87862a6d 100644 --- a/drivers/common/mlx5/mlx5_devx_cmds.c +++ b/drivers/common/mlx5/mlx5_devx_cmds.c @@ -2475,6 +2475,12 @@ mlx5_devx_cmd_create_qp(void *ctx, attr->dbr_umem_valid); MLX5_SET(qpc, qpc, dbr_umem_id, attr->dbr_umem_id); } + if (attr->cd_master) + MLX5_SET(qpc, qpc, cd_master, attr->cd_master); + if (attr->cd_slave_send) + MLX5_SET(qpc, qpc, cd_slave_send, attr->cd_slave_send); + if (attr->cd_slave_recv) + MLX5_SET(qpc, qpc, cd_slave_receive, attr->cd_slave_recv); MLX5_SET64(qpc, qpc, dbr_addr, attr->dbr_address); MLX5_SET64(create_qp_in, in, wq_umem_offset, attr->wq_umem_offset); diff --git a/drivers/common/mlx5/mlx5_devx_cmds.h b/drivers/common/mlx5/mlx5_devx_cmds.h index cb3f3a211b..e071cd841f 100644 --- a/drivers/common/mlx5/mlx5_devx_cmds.h +++ b/drivers/common/mlx5/mlx5_devx_cmds.h @@ -559,6 +559,9 @@ struct mlx5_devx_qp_attr { uint64_t wq_umem_offset; uint32_t user_index:24; uint32_t mmo:1; + uint32_t cd_master:1; + uint32_t cd_slave_send:1; + uint32_t cd_slave_recv:1; }; struct mlx5_devx_virtio_q_couners_attr { diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h index 96ce342d29..4990bcaacd 100644 --- a/drivers/common/mlx5/mlx5_prm.h +++ b/drivers/common/mlx5/mlx5_prm.h @@ -589,6 +589,17 @@ struct mlx5_rdma_write_wqe { struct mlx5_wqe_dseg dseg[]; } __rte_packed; +struct mlx5_wqe_send_en_seg { + uint32_t reserve[2]; + uint32_t sqnpc; + uint32_t qpn; +} __rte_packed; + +struct mlx5_wqe_send_en_wqe { + struct mlx5_wqe_cseg ctr; + struct mlx5_wqe_send_en_seg sseg; +} __rte_packed; + #ifdef PEDANTIC #pragma GCC diagnostic error "-Wpedantic" #endif -- 2.25.1