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 DD02A42A4E; Wed, 3 May 2023 13:50:46 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 00AC142D16; Wed, 3 May 2023 13:50:43 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2050.outbound.protection.outlook.com [40.107.244.50]) by mails.dpdk.org (Postfix) with ESMTP id 8E0D342C76 for ; Wed, 3 May 2023 13:50:40 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=btbA/iRJ6cAr0jhEYnBUIRgGVWf6HrOx+8NnMiz7eYYmsid2yG9wc41USCReonjCBO5IgZwBrJhvZYV42akHL7GX8ezKEHKSlx7Oh6OafIHEaoIa9NSv1n4aVzRGq/0CWgfpeIu0yXummp9T8Bu+JH12dlFt/NgF1KEHR6BZCVoIlK4GcGAu1xNnVkctc5pyK+HZQ3tNJW2GloTeKNaZ74H5Z/L491Mlwp+xCccNIBh+8XUnFZ6z+FUTr9GdRW9V0sAhjKx0rnxpoOqBjj5jhIFD50Ca7viS1p/IidJcI8Z11jlXvfG/QCDek3rQyrvgoRerEVpo7oFCuyByYpCLxA== 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=fpYg7/AosbxtYvGRwqmx7k2k61tpKH1VkwwMAwQFA1w=; b=CCBtqLVDJQKKAS+21H1joe2KKtOrcBqcoLS+VSfevs8e5wr3kujLKNRgFETm26DUhVMx/+zCaGoJIMGCC+jSAmT+Do/eMBLb2y95JNUC++ExbkJAwxCI6IJqd9L/572idqx4Bl1xbGpquBtbOqdCE5C9BtXy9fWK16a7v6nMjy0lVmzkv4UGEEe+Vdn2RNLvRJXDbvziCkqzoLz21hEDLFTR5vc7hEykxXubyASz65eFjQf/vIiBfoYZoCadjaKSNyEWjF8jERKwPRH/ibXJwDw7aEcRHEuhRAdyBhY2vFpIioT3BEOyJ8ELyFAzXcZjWG6HrGs4AsQXKetJ+KB5vA== 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=fpYg7/AosbxtYvGRwqmx7k2k61tpKH1VkwwMAwQFA1w=; b=uWGus0VCvvU1K4xhQ5VxytXbSFUgk2h9IWhOg2OjC3uwFKCcKCLtzYXC9Eo0gpPReBriQDHiFuLFUsAWzxRcg2VAt4aoKHfzxDr56145zNZDP3wvs31vOG+amACJ8VoiqFbirsSBZ5oiG30ycXajQzUYRdqS2u8Aq2Dt0lzWJlYMKzWbQniw222R+km7fyYQmBc3Hx+Gcnha5NeapTR61yfMXoktg+QKCcnOr8HUEE4kqFcbYt9neAGySbnwyx/OM3noPdCuqMoErNepajOZzsisagNe6LjfVKmFTK7cIR7n+4fuiqaDScI8TrQONy/7shtzOu/PQDMyeMZfQwdDhw== Received: from CY8PR22CA0016.namprd22.prod.outlook.com (2603:10b6:930:45::27) by SJ2PR12MB7963.namprd12.prod.outlook.com (2603:10b6:a03:4c1::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Wed, 3 May 2023 11:50:38 +0000 Received: from CY4PEPF0000E9D0.namprd03.prod.outlook.com (2603:10b6:930:45:cafe::1e) by CY8PR22CA0016.outlook.office365.com (2603:10b6:930:45::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.22 via Frontend Transport; Wed, 3 May 2023 11:50:38 +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 CY4PEPF0000E9D0.mail.protection.outlook.com (10.167.241.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.21 via Frontend Transport; Wed, 3 May 2023 11:50:38 +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.5; Wed, 3 May 2023 04:50:25 -0700 Received: from nvidia.com (10.126.231.37) 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; Wed, 3 May 2023 04:50:21 -0700 From: Tal Shnaiderman To: CC: , , , , , Subject: [PATCH 1/3] net/mlx5: support multi-packet RQ on Windows Date: Wed, 3 May 2023 14:49:19 +0300 Message-ID: <20230503114921.4588-2-talshn@nvidia.com> X-Mailer: git-send-email 2.16.1.windows.4 In-Reply-To: <20230503114921.4588-1-talshn@nvidia.com> References: <20230503114921.4588-1-talshn@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.126.231.37] 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: CY4PEPF0000E9D0:EE_|SJ2PR12MB7963:EE_ X-MS-Office365-Filtering-Correlation-Id: 199269b2-2c18-430e-c8ee-08db4bcc9d01 X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IqsR+FaLzGVWZTUYoy7LuCPdipvv+2QafflkzgZn7qiwoXyZy+2qpNhq6HsONmWIKKtQfxcUT8o8Vjz0IWe+bsd74RuhMkEod3q1G5YzB6CfjhkloJF7hxd6ztZd879dEboaySt5KXkBhzqMrZAOUZfscuIXTSvISAuAnhsU5hlhFMm5pK2am8oWWMpjtudgfXMM3CpmB82knKCwX4aXdJqaZH+3m3qpwgpdEti2crCwuF50ShCLumF4TEIsS9//Q1Qe9M53RRGQACtyyAy7AUy3CXo4z6CILPuZ66WkUTeVXaes5p8KHpp88Fv8HooUz+YJ2RwOS58ww5c7mRJ4g58MeAPL/JGHaFelSn4xNqsB0nDL8QpGSJTfGs9kLiQOCSTNsGGhlo8ClRM51qQjsnEFj4Kt2yf88nZnCjLAno7Hw0rXeJqK9H6kkhP99dCPIV3GLjlH0L+piC3/afjt4+WObS2Symx8FhCmFdxYymBz2Y3AZc5qVwDeseqvqiPeVC4J8nEIK1kyAaTH57CsdXFTrCB2wRsCqWR7PkfGjeBcYPfFv5qygYnmYSmizvZKCYyM/tBnOkvmMrOSoxixnGzkowRH6NxQZD8adntQODXQCGfljxGGs5IEZIWCIUmIo4RNNNO+TTrUVzoAPU0nhVpOGREU+ThEZ1p1eJuhR5vA4y9LdHLYpMbQlailaEgvClXNUU5Wds+ZQLjU85fzfQ== 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:(13230028)(4636009)(39860400002)(396003)(346002)(136003)(376002)(451199021)(36840700001)(46966006)(40470700004)(36756003)(316002)(6916009)(4326008)(54906003)(70206006)(70586007)(7696005)(41300700001)(478600001)(40480700001)(55016003)(2906002)(5660300002)(8936002)(8676002)(82310400005)(356005)(6286002)(7636003)(82740400003)(186003)(16526019)(2616005)(107886003)(26005)(36860700001)(1076003)(336012)(86362001)(47076005)(426003)(83380400001)(40460700003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 May 2023 11:50:38.1514 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 199269b2-2c18-430e-c8ee-08db4bcc9d01 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: CY4PEPF0000E9D0.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB7963 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 Multi-Packet RQ can further save PCIe bandwidth by posting a single large buffer for multiple packets. Instead of posting a buffer per a packet, one large buffer is posted to receive multiple packets on the buffer. Add support for multi-packet RQ on Windows. The feature is disabled by default and can by enabled by setting mprq_en=1 in the PMD specific arguments. Signed-off-by: Tal Shnaiderman --- drivers/common/mlx5/mlx5_devx_cmds.c | 3 +++ drivers/common/mlx5/mlx5_devx_cmds.h | 2 ++ drivers/common/mlx5/windows/mlx5_win_defs.h | 8 +++++++- drivers/net/mlx5/windows/mlx5_os.c | 26 ++++++++++++++++++++++++++ 4 files changed, 38 insertions(+), 1 deletion(-) diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c b/drivers/common/mlx5/mlx5_devx_cmds.c index d0907fcd49..096bd1d520 100644 --- a/drivers/common/mlx5/mlx5_devx_cmds.c +++ b/drivers/common/mlx5/mlx5_devx_cmds.c @@ -1076,6 +1076,9 @@ mlx5_devx_cmd_query_hca_attr(void *ctx, general_obj_types) & MLX5_GENERAL_OBJ_TYPES_CAP_CONN_TRACK_OFFLOAD); attr->rq_delay_drop = MLX5_GET(cmd_hca_cap, hcattr, rq_delay_drop); + attr->striding_rq = MLX5_GET(cmd_hca_cap, hcattr, striding_rq); + attr->ext_stride_num_range = + MLX5_GET(cmd_hca_cap, hcattr, ext_stride_num_range); attr->max_flow_counter_15_0 = MLX5_GET(cmd_hca_cap, hcattr, max_flow_counter_15_0); attr->max_flow_counter_31_16 = MLX5_GET(cmd_hca_cap, hcattr, diff --git a/drivers/common/mlx5/mlx5_devx_cmds.h b/drivers/common/mlx5/mlx5_devx_cmds.h index ce173bc36a..9e7992b1c6 100644 --- a/drivers/common/mlx5/mlx5_devx_cmds.h +++ b/drivers/common/mlx5/mlx5_devx_cmds.h @@ -282,6 +282,8 @@ struct mlx5_hca_attr { uint32_t crypto_wrapped_import_method:1; uint16_t esw_mgr_vport_id; /* E-Switch Mgr vport ID . */ uint16_t max_wqe_sz_sq; + uint32_t striding_rq:1; + uint32_t ext_stride_num_range:1; uint32_t set_reg_c:8; uint32_t nic_flow_table:1; uint32_t modify_outer_ip_ecn:1; diff --git a/drivers/common/mlx5/windows/mlx5_win_defs.h b/drivers/common/mlx5/windows/mlx5_win_defs.h index 65da820c5e..885114655f 100644 --- a/drivers/common/mlx5/windows/mlx5_win_defs.h +++ b/drivers/common/mlx5/windows/mlx5_win_defs.h @@ -270,4 +270,10 @@ enum { MLX5_MATCH_INNER_HEADERS = RTE_BIT32(2), }; -#endif /* MLX5_WIN_DEFS_H */ +#define MLX5_MIN_SINGLE_WQE_LOG_NUM_STRIDES 9 +#define MLX5_MAX_SINGLE_WQE_LOG_NUM_STRIDES 16 +#define MLX5_MIN_SINGLE_STRIDE_LOG_NUM_BYTES 6 +#define MLX5_MAX_SINGLE_STRIDE_LOG_NUM_BYTES 13 +#define MLX5_EXT_MIN_SINGLE_WQE_LOG_NUM_STRIDES 3 +#define IB_QPT_RAW_PACKET 8 +#endif /* __MLX5_WIN_DEFS_H__ */ diff --git a/drivers/net/mlx5/windows/mlx5_os.c b/drivers/net/mlx5/windows/mlx5_os.c index f401264b61..0caa8931e4 100644 --- a/drivers/net/mlx5/windows/mlx5_os.c +++ b/drivers/net/mlx5/windows/mlx5_os.c @@ -187,6 +187,32 @@ mlx5_os_capabilities_prepare(struct mlx5_dev_ctx_shared *sh) if (sh->dev_cap.tso) sh->dev_cap.tso_max_payload_sz = 1 << hca_attr->max_lso_cap; DRV_LOG(DEBUG, "Counters are not supported."); + if (hca_attr->striding_rq) { + sh->dev_cap.mprq.enabled = 1; + sh->dev_cap.mprq.log_min_stride_size = + MLX5_MIN_SINGLE_STRIDE_LOG_NUM_BYTES; + sh->dev_cap.mprq.log_max_stride_size = + MLX5_MAX_SINGLE_STRIDE_LOG_NUM_BYTES; + if (hca_attr->ext_stride_num_range) + sh->dev_cap.mprq.log_min_stride_num = + MLX5_EXT_MIN_SINGLE_WQE_LOG_NUM_STRIDES; + else + sh->dev_cap.mprq.log_min_stride_num = + MLX5_MIN_SINGLE_WQE_LOG_NUM_STRIDES; + sh->dev_cap.mprq.log_max_stride_num = + MLX5_MAX_SINGLE_WQE_LOG_NUM_STRIDES; + DRV_LOG(DEBUG, "\tmin_single_stride_log_num_of_bytes: %u", + sh->dev_cap.mprq.log_min_stride_size); + DRV_LOG(DEBUG, "\tmax_single_stride_log_num_of_bytes: %u", + sh->dev_cap.mprq.log_max_stride_size); + DRV_LOG(DEBUG, "\tmin_single_wqe_log_num_of_strides: %u", + sh->dev_cap.mprq.log_min_stride_num); + DRV_LOG(DEBUG, "\tmax_single_wqe_log_num_of_strides: %u", + sh->dev_cap.mprq.log_max_stride_num); + DRV_LOG(DEBUG, "\tmin_stride_wqe_log_size: %u", + sh->dev_cap.mprq.log_min_stride_wqe_size); + DRV_LOG(DEBUG, "Device supports Multi-Packet RQ."); + } if (hca_attr->rss_ind_tbl_cap) { /* * DPDK doesn't support larger/variable indirection tables. -- 2.16.1.windows.4