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 2CA80A0543; Mon, 6 Jun 2022 13:22:38 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BCFA342B8B; Mon, 6 Jun 2022 13:22:04 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2089.outbound.protection.outlook.com [40.107.223.89]) by mails.dpdk.org (Postfix) with ESMTP id 977B942B82 for ; Mon, 6 Jun 2022 13:22:03 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lcFzjSKvHwfp+5DjcUfRDuvTWp2H1HqqqvBbetz+xo8ZyLhQJajuwpFpWP18d8PZ7et+Xm9iBqY6Kh9pSsN72g1WKCGi9xL+FNRsZ75M5eDkOwh/CyBcPrkBlTey3QA5h5xZ0G8ervrK6q768bSbiWEyenkpehRqTPH4wep3gBp6M0bTvI7UkZJygh/rU0Q8ifWucOqJfFWvXkPZ2uZGPvBJMH+7X2pdT19DNd3bCQqRNvcq4t9j50hCg2J0vIy8gfWrgDBnc1LajcqgpN0a4TuIPTVF65BY1lUK1d5EsredCi87akVyx8cVDgqTYc2VLRRevp1m44OiwusjCh+e+w== 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=We/bsNcpSpBekIWDvBf9E+epWgYn0d2hG5xm0p+Apr4=; b=Czxzsarw2qLEM1F5yxXBr8jsVZPkp9ewKNIf5EaS+X1ggjYTMgK8iV/q33CcVBFLoebwVQHzL1L5CSikWiRCf37N5/YlIYK+HBEGe9TQOnnk+qIavuOK/CU3hbRIJtf66MQl0B2BgZhTW8MN7rBLGGxTM/ccqBJeV/l3XtcZt/eVBfleh5jUqhPBDoNJsF6AfQFHNHmkijGlESj7MCk/cCvK5MS2bYv4Y0TX26Un+LslVhFSpMpd+mNez1tD8fSVhsWHkwqSIdLREw8LU2F6bpKBVD3Z7xGsrHwElLj5ErMXUBTZH46eKeQ3l5OMaklJs1Rn9jLOFttzG/dG/lyeAg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.235) smtp.rcpttodomain=monjalon.net 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=We/bsNcpSpBekIWDvBf9E+epWgYn0d2hG5xm0p+Apr4=; b=epXdDzuZXGdgP5vV6h1p2GMfeOYE1fXw0rKxFXmYeRig0PXBxQelNDN33FaJKvK2gtX62lhVsfBffnf8rziij5JNWk7oRBqrIK/2V+MFvLwiZxPlDD028jf3fmVZnW3tfu0+hyXojmT4cUwOn6U/+4diWSK959BqmvlLbziUYpo1kOAUBsabtzqyeyx10pMMPudSPZei/CJMyiklc6a9OH0gTGx4uK1Ezl5FEQuylN1mJEY4nFACmRUMDRz0HjXPysiwPMO/5hENBhOZZERt4Gaww4kAW71oO4PC/S6MoNjhILW3g12jpWS4Rr6IGf9DVXbiXqzCGjaUzRc7vV8Btw== Received: from BN8PR07CA0004.namprd07.prod.outlook.com (2603:10b6:408:ac::17) by CY5PR12MB6407.namprd12.prod.outlook.com (2603:10b6:930:3c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.18; Mon, 6 Jun 2022 11:22:01 +0000 Received: from BN8NAM11FT014.eop-nam11.prod.protection.outlook.com (2603:10b6:408:ac:cafe::db) by BN8PR07CA0004.outlook.office365.com (2603:10b6:408:ac::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.17 via Frontend Transport; Mon, 6 Jun 2022 11:22:01 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.235) 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 12.22.5.235 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.235; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.235) by BN8NAM11FT014.mail.protection.outlook.com (10.13.177.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5314.12 via Frontend Transport; Mon, 6 Jun 2022 11:22:01 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Mon, 6 Jun 2022 11:22:00 +0000 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.22; Mon, 6 Jun 2022 04:21:57 -0700 From: Li Zhang To: , , , CC: , , , , Yajun Wu Subject: [PATCH v1 05/17] common/mlx5: add DevX API to move QP to reset state Date: Mon, 6 Jun 2022 14:20:45 +0300 Message-ID: <20220606112109.208873-9-lizh@nvidia.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220606112109.208873-1-lizh@nvidia.com> References: <20220408075606.33056-1-lizh@nvidia.com> <20220606112109.208873-1-lizh@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f2dfe36e-b738-4e0e-88c3-08da47aec71a X-MS-TrafficTypeDiagnostic: CY5PR12MB6407:EE_ X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JDNEc7XmEqeBTmT8R27Qnre+qUkP00EUt0DSNYUPoe17Suzi9a1lHhNWIy0LFsHOUhnwBnPonY8QRfBdh3T7Wx4YS1nFlUMsYOYLj3NMAt0SLWfLJ/HoAi3HPMnMtw+0NrIdv8txMY18RrbJCdGoLNtv+GrULmS59WQLpJXKCGJd+VM8r8/w3N7H3m0Afef8UgLEW3KCn16mvI4Ucm02bVmWjitgy4NC4JgkcbQC7EROGHFFO7Jg4t+/g/zseJ/psMWuZ/zkn8pHrS0VW95NVdGeJPkCAPswdBI771HJ0E4r3zV3FnYsKqQazQPylBJiI2twF1PAT5bjpwffgMomuGMivRgusd3h11J9syqOQVNKTekKEkqYDQ/l1EOrxwy9h7b3cNDm0EigRMXKAJ5uwzc3F2WtS+sGS/VRQ0chIzJcraQ0VT5XxGY/qzEDw31UJ8/da7aHhc/wLo8x03P7VS4U+9sve7DgI9ZtZcWEz0sVJ/ABLoeJRebsJY09SoYqSGEQTzK3wcVYthpb9/2N5AkO+dAAa/SP7M2ZXeIHbTXN5TIdjg3Ch8SAsGV/PMVwS9T5z/hUz9VlRt3WtyDL4mp3pYEfXSoSpgel5T1fY2HNLsAuD0TgItAxOM/VcMFiaQf/GuMDP4x1rUShy4G7ykC8BYLWJ/kjjs663Y8ZnBp9kbFjwMu4BTkYtSyhT3+y3k2nK8mKAv/mtlvRUFIo7Q== X-Forefront-Antispam-Report: CIP:12.22.5.235; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(40470700004)(36840700001)(46966006)(110136005)(7696005)(16526019)(36860700001)(4326008)(426003)(336012)(186003)(2906002)(26005)(6286002)(5660300002)(2616005)(82310400005)(8936002)(47076005)(40460700003)(54906003)(107886003)(81166007)(70206006)(6666004)(1076003)(55016003)(508600001)(356005)(36756003)(70586007)(86362001)(6636002)(316002)(8676002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2022 11:22:01.4914 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f2dfe36e-b738-4e0e-88c3-08da47aec71a X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.235]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT014.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6407 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 From: Yajun Wu Support set QP to RESET state. Signed-off-by: Yajun Wu --- drivers/common/mlx5/mlx5_devx_cmds.c | 7 +++++++ drivers/common/mlx5/mlx5_prm.h | 17 +++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c b/drivers/common/mlx5/mlx5_devx_cmds.c index c6bdbc12bb..1d6d6578d6 100644 --- a/drivers/common/mlx5/mlx5_devx_cmds.c +++ b/drivers/common/mlx5/mlx5_devx_cmds.c @@ -2264,11 +2264,13 @@ mlx5_devx_cmd_modify_qp_state(struct mlx5_devx_obj *qp, uint32_t qp_st_mod_op, uint32_t rst2init[MLX5_ST_SZ_DW(rst2init_qp_in)]; uint32_t init2rtr[MLX5_ST_SZ_DW(init2rtr_qp_in)]; uint32_t rtr2rts[MLX5_ST_SZ_DW(rtr2rts_qp_in)]; + uint32_t qp2rst[MLX5_ST_SZ_DW(2rst_qp_in)]; } in; union { uint32_t rst2init[MLX5_ST_SZ_DW(rst2init_qp_out)]; uint32_t init2rtr[MLX5_ST_SZ_DW(init2rtr_qp_out)]; uint32_t rtr2rts[MLX5_ST_SZ_DW(rtr2rts_qp_out)]; + uint32_t qp2rst[MLX5_ST_SZ_DW(2rst_qp_out)]; } out; void *qpc; int ret; @@ -2311,6 +2313,11 @@ mlx5_devx_cmd_modify_qp_state(struct mlx5_devx_obj *qp, uint32_t qp_st_mod_op, inlen = sizeof(in.rtr2rts); outlen = sizeof(out.rtr2rts); break; + case MLX5_CMD_OP_QP_2RST: + MLX5_SET(2rst_qp_in, &in, qpn, qp->id); + inlen = sizeof(in.qp2rst); + outlen = sizeof(out.qp2rst); + break; default: DRV_LOG(ERR, "Invalid or unsupported QP modify op %u.", qp_st_mod_op); diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h index bc3e70a1d1..8a2f55c33e 100644 --- a/drivers/common/mlx5/mlx5_prm.h +++ b/drivers/common/mlx5/mlx5_prm.h @@ -3657,6 +3657,23 @@ struct mlx5_ifc_init2init_qp_in_bits { u8 reserved_at_800[0x80]; }; +struct mlx5_ifc_2rst_qp_out_bits { + u8 status[0x8]; + u8 reserved_at_8[0x18]; + u8 syndrome[0x20]; + u8 reserved_at_40[0x40]; +}; + +struct mlx5_ifc_2rst_qp_in_bits { + u8 opcode[0x10]; + u8 uid[0x10]; + u8 vhca_tunnel_id[0x10]; + u8 op_mod[0x10]; + u8 reserved_at_80[0x8]; + u8 qpn[0x18]; + u8 reserved_at_a0[0x20]; +}; + struct mlx5_ifc_dealloc_pd_out_bits { u8 status[0x8]; u8 reserved_0[0x18]; -- 2.31.1