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 472DAA00C3; Mon, 19 Sep 2022 18:39:08 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3AE5842802; Mon, 19 Sep 2022 18:39:08 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2087.outbound.protection.outlook.com [40.107.237.87]) by mails.dpdk.org (Postfix) with ESMTP id B477D40141 for ; Mon, 19 Sep 2022 18:39:06 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bWmnCmlfYziD3mQPPbPv5gDNQkOoTVIm6yt4pbfN8YL3h0stfPN4nZyZWXQb8RfWHY/YnvR9UWbrcwDWbC0l/j/qebbDKdX2ENUdrYYgUt5IxQ6mmr8cx1a1/4QE1EzVsW7Jp6FNyrOd5xHTfHpCdiYMHHOxKJ8Dk4gA7ZGR0kxjPgITxWJvfoPPMrOGWO0Di9439pwwqDXdwhM/aquAk8gGw7MTKL7qeFlbgLDRWaItzevGe1hCydT51ZfYvtGJMJ16l4rFPP6383vzB9pHNkPQIH9qlL+Uq68WuUcrn520Z6Ozyxz+cxv5vo0r/7FTwR3jmVTfoj9dCmR9z+ctEg== 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=ZamNnuu/CT7Ciym9/Wte9/Gl1pBUxcEmVADu8+z0Mlo=; b=LpAXtXQ9Ii5SfpL3liA6+cTZNg4WqH4BPkvlVbGWkvGa/TDHMzrJQovyy7waR+9E9G7Ic1MiHpXWzBE3I1oRtPgfvoBwARJdJp+Pzyj+Mb6BQhRrUZ766xlEmWgsqMesFm28SlIU06/u+sUQEc4yvk27eWmM91VNsvNhdraKr1fWpGk+IvXqRlq9ZZv2V18WMIGKBuP1QKL9s6KoQq4kS4pSb0GmIRfrf3S097iMOb0UejKJV0FN0UxdPTvynwiXX6MXOFsqKJpKkvzpwTzw9vu52GbmHUQu5Hwxx/1lkE9ZsTwyE+HfPdNNm2jdme6vKP7B4L0xq8lkwQProWDjaA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=dpdk.org 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=ZamNnuu/CT7Ciym9/Wte9/Gl1pBUxcEmVADu8+z0Mlo=; b=Wtpf1KcttzHaJ1SmyqgqFc2dBuBXTtZoFJVzaMSMnzGOAQ7W04Yx2bkTyrdh7ohawhR7V+fl+niae0tjaSDvqcPKre6e9e3YofleKgAVBtff5rnA7sucRGJDymsLeL77J+zpzP0D0u5uz/7v6Oc3gbGwug4jeB02YFfKGOTxYKP28SRq/KlYAyoBksKiMdbnFbdsLMJHVC6+4hfLnBvmTrKndRWpJ7jAYkSlJ+M0l7TlZ7keQJZ4fTE/3td6jOgDrUMOE2EgQGENPMojnJo0IARBON1rWjVtUCcs1XaMTnlbJIqnVccZJL+WrYjY1rlEJCw4IeJf2lTDqRHCLLsGjg== Received: from DM6PR06CA0032.namprd06.prod.outlook.com (2603:10b6:5:120::45) by SA1PR12MB6824.namprd12.prod.outlook.com (2603:10b6:806:25f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.15; Mon, 19 Sep 2022 16:39:05 +0000 Received: from DM6NAM11FT104.eop-nam11.prod.protection.outlook.com (2603:10b6:5:120:cafe::1e) by DM6PR06CA0032.outlook.office365.com (2603:10b6:5:120::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.21 via Frontend Transport; Mon, 19 Sep 2022 16:39:05 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by DM6NAM11FT104.mail.protection.outlook.com (10.13.173.232) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.12 via Frontend Transport; Mon, 19 Sep 2022 16:39:04 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Mon, 19 Sep 2022 09:38:54 -0700 Received: from nvidia.com (10.126.230.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.29; Mon, 19 Sep 2022 09:38:53 -0700 From: Dariusz Sosnowski To: Matan Azrad , Viacheslav Ovsiienko CC: Subject: [PATCH 2/7] common/mlx5: add hairpin SQ buffer type capabilities Date: Mon, 19 Sep 2022 16:37:25 +0000 Message-ID: <20220919163731.1540454-3-dsosnowski@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220919163731.1540454-1-dsosnowski@nvidia.com> References: <20220919163731.1540454-1-dsosnowski@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.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-TrafficTypeDiagnostic: DM6NAM11FT104:EE_|SA1PR12MB6824:EE_ X-MS-Office365-Filtering-Correlation-Id: 8882365a-f231-433c-75c7-08da9a5d7757 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8hXZL/Izc4Fq0AmxoIoA7BdPhpYKirx3ZDc2lhaXN6hpS40MN1zeokwZCBdC+3uCl0jTRe9UJSfDrLc4FeuJzPLk1quqnv8/cdIE6yVbYQBcQv41KzWVptOTM9N72kij0Vp3PGK40RL/ViDtSewruViIISJpZuwY5rjq7FH7KCfK4LKNhc/V8NnMkFTmPnRj5QBMXN+siKkW79EXsl3V4IB92d2BGQ1WK2nZn2Wro5zRtcHMri9kYooYYKQykAk26K3JxRSMCoo/u3mOX/FcmJFpnsLZPZazK55pT6OkBXTlobbJbvsew6Pa568aPB9KxfH46xk+ifkDtOuPcXJ0xAWZb1PMiQHDS8Pd5O2irC/HNwuGGTfAGiQAlkQJZd79QRTSlujcO2RARF8bGK4G8Jmw93x770W2+kLtNK8ZrGz8a5gsXhg4JwDDnRimH1pOHm/p6D8d9bvm1gqw4PaEB6jAKBGL3u3aFLModvSSvQMFLXzFLjf27YN/rkdIHIP5fzcYQACeRW1xPfEREGuJtveoGCnZtJVis60+xy8WmQw5Fl2lzKTTr98GipFEj2tDihAWoC0bi601VVcq2c8g3Kg/ArFizurQbwI/XnvIZTeh9p+3p1HemSBZUR/khwSB6kSuRB4rbx4yTAHYSsIrcxC2bsqL3zFBKSIKUTlVObNi4Vq5tppG8JYi7RG7LjkVKxCNSJIynov6rOVe3cXHNswrZJ1+OcbkBn6OKVHRjYevgBXfPCrgT72T501N3grcFhlwdcHXr1eBBsp6SmKOkA== X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230022)(4636009)(376002)(136003)(396003)(39860400002)(346002)(451199015)(36840700001)(46966006)(40470700004)(316002)(478600001)(110136005)(6636002)(40480700001)(36860700001)(6286002)(82310400005)(7696005)(26005)(356005)(8936002)(70586007)(40460700003)(2906002)(4326008)(2616005)(6666004)(70206006)(8676002)(7636003)(5660300002)(86362001)(41300700001)(83380400001)(16526019)(186003)(336012)(82740400003)(1076003)(47076005)(426003)(55016003)(36756003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2022 16:39:04.9640 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8882365a-f231-433c-75c7-08da9a5d7757 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.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT104.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6824 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 This patch extends HCA_CAP and SQ Context structs available in PRM. This fields allow checking if NIC supports storing hairpin SQ's WQ buffer in host memory and configuring such memory placement. HCA capabilities are extended with the following fields: - hairpin_sq_wq_in_host_mem - If set, then NIC supports using host memory as a backing storage for hairpin SQ's WQ buffer. - hairpin_sq_wqe_bb_size - Indicates the required size of SQ WQE basic block. SQ Context is extended with hairpin_wq_buffer_type which informs NIC where SQ's WQ buffer will be stored. This field can take the following values: - MLX5_SQC_HAIRPIN_WQ_BUFFER_TYPE_INTERNAL_BUFFER - WQ buffer will be stored in unlocked device memory. - MLX5_SQC_HAIRPIN_WQ_BUFFER_TYPE_HOST_MEMORY - WQ buffer will be stored in host memory. Buffer is provided by PMD. Signed-off-by: Dariusz Sosnowski --- drivers/common/mlx5/mlx5_devx_cmds.c | 5 +++++ drivers/common/mlx5/mlx5_devx_cmds.h | 3 +++ drivers/common/mlx5/mlx5_prm.h | 15 +++++++++++++-- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c b/drivers/common/mlx5/mlx5_devx_cmds.c index 8880a9f3b5..2b12ce0d4c 100644 --- a/drivers/common/mlx5/mlx5_devx_cmds.c +++ b/drivers/common/mlx5/mlx5_devx_cmds.c @@ -981,6 +981,10 @@ mlx5_devx_cmd_query_hca_attr(void *ctx, } attr->log_min_stride_wqe_sz = MLX5_GET(cmd_hca_cap_2, hcattr, log_min_stride_wqe_sz); + attr->hairpin_sq_wqe_bb_size = MLX5_GET(cmd_hca_cap_2, hcattr, + hairpin_sq_wqe_bb_size); + attr->hairpin_sq_wq_in_host_mem = MLX5_GET(cmd_hca_cap_2, hcattr, + hairpin_sq_wq_in_host_mem); } if (attr->log_min_stride_wqe_sz == 0) attr->log_min_stride_wqe_sz = MLX5_MPRQ_LOG_MIN_STRIDE_WQE_SIZE; @@ -1698,6 +1702,7 @@ mlx5_devx_cmd_create_sq(void *ctx, MLX5_SET(sqc, sq_ctx, hairpin, sq_attr->hairpin); MLX5_SET(sqc, sq_ctx, non_wire, sq_attr->non_wire); MLX5_SET(sqc, sq_ctx, static_sq_wq, sq_attr->static_sq_wq); + MLX5_SET(sqc, sq_ctx, hairpin_wq_buffer_type, sq_attr->hairpin_wq_buffer_type); MLX5_SET(sqc, sq_ctx, user_index, sq_attr->user_index); MLX5_SET(sqc, sq_ctx, cqn, sq_attr->cqn); MLX5_SET(sqc, sq_ctx, packet_pacing_rate_limit_index, diff --git a/drivers/common/mlx5/mlx5_devx_cmds.h b/drivers/common/mlx5/mlx5_devx_cmds.h index af6053a788..9ac2d75df4 100644 --- a/drivers/common/mlx5/mlx5_devx_cmds.h +++ b/drivers/common/mlx5/mlx5_devx_cmds.h @@ -191,6 +191,8 @@ struct mlx5_hca_attr { uint32_t log_max_hairpin_queues:5; uint32_t log_max_hairpin_wq_data_sz:5; uint32_t log_max_hairpin_num_packets:5; + uint32_t hairpin_sq_wqe_bb_size:4; + uint32_t hairpin_sq_wq_in_host_mem:1; uint32_t vhca_id:16; uint32_t relaxed_ordering_write:1; uint32_t relaxed_ordering_read:1; @@ -407,6 +409,7 @@ struct mlx5_devx_create_sq_attr { uint32_t non_wire:1; uint32_t static_sq_wq:1; uint32_t ts_format:2; + uint32_t hairpin_wq_buffer_type:3; uint32_t user_index:24; uint32_t cqn:24; uint32_t packet_pacing_rate_limit_index:16; diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h index 4346279c81..04d35ca845 100644 --- a/drivers/common/mlx5/mlx5_prm.h +++ b/drivers/common/mlx5/mlx5_prm.h @@ -2020,7 +2020,11 @@ struct mlx5_ifc_cmd_hca_cap_2_bits { u8 reserved_at_d8[0x3]; u8 log_max_conn_track_offload[0x5]; u8 reserved_at_e0[0x20]; /* End of DW7. */ - u8 reserved_at_100[0x700]; + u8 reserved_at_100[0x60]; + u8 reserved_at_160[0x3]; + u8 hairpin_sq_wqe_bb_size[0x5]; + u8 hairpin_sq_wq_in_host_mem[0x1]; + u8 reserved_at_169[0x697]; }; struct mlx5_ifc_esw_cap_bits { @@ -2673,6 +2677,11 @@ enum { MLX5_SQC_STATE_ERR = 0x3, }; +enum { + MLX5_SQC_HAIRPIN_WQ_BUFFER_TYPE_INTERNAL_BUFFER = 0x0, + MLX5_SQC_HAIRPIN_WQ_BUFFER_TYPE_HOST_MEMORY = 0x1, +}; + struct mlx5_ifc_sqc_bits { u8 rlky[0x1]; u8 cd_master[0x1]; @@ -2686,7 +2695,9 @@ struct mlx5_ifc_sqc_bits { u8 hairpin[0x1]; u8 non_wire[0x1]; u8 static_sq_wq[0x1]; - u8 reserved_at_11[0x9]; + u8 reserved_at_11[0x4]; + u8 hairpin_wq_buffer_type[0x3]; + u8 reserved_at_18[0x2]; u8 ts_format[0x02]; u8 reserved_at_1c[0x4]; u8 reserved_at_20[0x8]; -- 2.25.1