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 BA82CA0542; Mon, 6 Jun 2022 13:47:57 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7993A42B6E; Mon, 6 Jun 2022 13:47:34 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2072.outbound.protection.outlook.com [40.107.92.72]) by mails.dpdk.org (Postfix) with ESMTP id 9BAD142B6E for ; Mon, 6 Jun 2022 13:47:33 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I5WNrv5Jg26Sn6LwnBdIP6IbLtWQlyEo/6yqOYdM0zO1bXHK3vWLKPPSbK4cS3g3Fi38YvI7DtSz02qgpK3/oQfbGPin0RuOr2hORt/kTrza+g+gzJrwM1H2mI9ZXcE5SadjeFt0MeMQjBN1YznlarUM56rfkA7W8qYQaTP2POM1a8pQBrTJya0SRwerA5xIvR3JdD0+Hg43e9n/WBxfxuOlRquxlZn3XdgZ03xFJxJRPKjGTgx4Ittq0pq1uROHCpBjqOuZLAzKmuGB9esy0nDmtOMpGPtWBx8/sjogHJXhPhxiF0rHMCsT6lKOUGtYE4yp/Iv+4zyxIVK5bCuZVA== 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=Y0lrDz2VhrLg0RlrFamnGQZhI/G9oQdU6zpZfoiAGmvGZnkiPWQW9Tx7M66u4ixV95v0i9BwLTUPa1wfhDY/kSyx/kvt8+RqWPLPZxd/NCuSwgjBisdrAEsNln+m8412SWxNznQ2DywyrrKJlgq4SOuNaOT4RDec2ubdVU7mKnwrx5hVk3iiQk7nUrFbhp01CqOTZYhZuJFAWZ01yBYAo8lO2/cY2RlmGXnyjA1pYpB5y7Ik0GYzszb8TB4tZnoPY6J2hVi2HGvlabctcEd8aSU1As5Ke18GAy9q+ZQo7ud3uGsDyh4/N3p6vduYhYzWoExbA35LbEbNBVWPPLpTxg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.236) 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=ewh8d+3KSvxZWlLX04PmfgwrzMhRg4JrrTLIpvKAp8/rBeMeN4HZU1tAJkz/4w36OkmvE2XnINF43bdCwqVf2S0pqCbyUng85pRn48ysMGy9akQmlVk6fZPoOnjDmO+mEX44enygx6CQCiwarmKRKV2ZNgsrMZbULvZgMNmZxqUFXzQX2pYLt35pKY2I9mAPKe0UTwaXS38i2cHVYarQPMl7R0rD4ROEJ/QJckDu7R1n7td+itiNy08VDkRhhEn9rWV+iRLW+t3DgpKCQcP96CPBURs8cISz5nOwhKFUQwLrCWahj3AkOCfuOeY0rc/82gG9rqIBXl2N6OKzlheW5g== Received: from MWHPR1701CA0017.namprd17.prod.outlook.com (2603:10b6:301:14::27) by LV2PR12MB5965.namprd12.prod.outlook.com (2603:10b6:408:172::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.19; Mon, 6 Jun 2022 11:47:32 +0000 Received: from CO1NAM11FT046.eop-nam11.prod.protection.outlook.com (2603:10b6:301:14:cafe::7) by MWHPR1701CA0017.outlook.office365.com (2603:10b6:301:14::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.19 via Frontend Transport; Mon, 6 Jun 2022 11:47:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.236) 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.236 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.236; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.236) by CO1NAM11FT046.mail.protection.outlook.com (10.13.174.203) 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:47:31 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL109.nvidia.com (10.27.9.19) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Mon, 6 Jun 2022 11:47:30 +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:47:27 -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:46:38 +0300 Message-ID: <20220606114650.209612-6-lizh@nvidia.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220606114650.209612-1-lizh@nvidia.com> References: <20220408075606.33056-1-lizh@nvidia.com> <20220606114650.209612-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: f3af62c6-55f3-4337-c9f3-08da47b25700 X-MS-TrafficTypeDiagnostic: LV2PR12MB5965: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: CACLLdc03n8FBgQo4w0UEN2L9/Djd0qU67cUxGHwD03RkQscGmO4Q8cKUvozP5/bt34AlN1ypQZWS7YLcpOHvSHeOevDHikitTnnBByycFMPRaXUogx2uOJJoNhkGz+Ox6BQv2x4AvT1YMPdvcoi9/evINTqBT+G4IzuAZad76AzV5coq5/VeCBadUGo/6YEIjbZ7ZfcugHZYbIcNl81q3vjMbs63EhkHjwGU4WtJpsYJFjZSzruU27oY9hXkFsupC1qfrZTiml9Uz1QY+O/Nn+MmE078qz1kBffUDvqxYVYjh9fuVGtGiXEnJtow8dhfwjSpGEMCVmQCWMt8t9RBDUemux49uZiTja3srtUd/8PDa0vzQnaMcs3QCLqqRoGB7cA6fYToIei4FCBjzJPzom+vs2qKqsrZYdqcm3zmGWszoGZ7Zg7pPy9qrId4EpXfwu8AnEkinKHfuPN441iqfcBnKRjPY07j0gGxRMSAA4++EDdm8w9rF59HUCsUWX/ujzYJv8YzoAYxjnCH0T8FueRE4csibdVji1jpmjP1zxm3LepDa9pUIyB+r00BcpcKrOO/mmwEMpUOgfiJgQZbCUVYOJHtRGR9/vo+Zxc6ybOpdu67xJwNTKyrf8uWkWTfmm0ZkGJqkyB6ndSU5ZOkPgNcWklQLT096l/qzDi+EAmCz9J7wquLJP2rfeX7k5l83NUu39PoWQRdvmS+nJptA== X-Forefront-Antispam-Report: CIP:12.22.5.236; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(46966006)(40470700004)(36840700001)(186003)(36860700001)(16526019)(316002)(6636002)(110136005)(70586007)(40460700003)(54906003)(356005)(86362001)(2906002)(8676002)(70206006)(4326008)(81166007)(5660300002)(8936002)(36756003)(107886003)(508600001)(1076003)(2616005)(6666004)(82310400005)(55016003)(7696005)(6286002)(336012)(47076005)(426003)(26005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2022 11:47:31.4516 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f3af62c6-55f3-4337-c9f3-08da47b25700 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.236]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT046.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5965 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