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 647F9A050A; Tue, 12 Apr 2022 17:01:26 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EE97F41611; Tue, 12 Apr 2022 17:01:24 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2056.outbound.protection.outlook.com [40.107.92.56]) by mails.dpdk.org (Postfix) with ESMTP id B007A410E1 for ; Tue, 12 Apr 2022 17:01:23 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IWwtXJWkWZsfFUuiVVeZ/EEEGAjOqae9q+00JwhKf0g1cmjgZ+uEhVpZoNUyBds7E7v2t4Ccfn7lfkOxWEJ4DBOkySy9loKlRXGMJbA1Uy555YO3AMglBWgyJCS058LULshmPiMjWUQBzihotUw+jY7HhV3kwg1dmcs2cYslp5ZPuZzyGsrqTS/vYgrM3/7zaG+ysZWmeOwmorAtsr7bZ5hkXSFQunSMYbuN/0EATRmLBpGeZi88RtRqo4j+xxmUylIUa8iW9eK+uFSowzyzckqTOegzEDa8BMN89/iDzIWTKsNliBOeenvQUTYud8QDJeO9MBMjsxTiZk+f2bYDWQ== 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=jFHvo71J3QpKM0TZjVa4TOw0ewX69LaBlwjdTp5JjJQ=; b=BSEApSOW5KRfNUrVaFszYAmah2gVL8kZtrUplDWVB+uFvgF7BHhaG/uSkP3AQBvczb4AH3R3rG9UYByt/1hxcbzmdR/7ZHXJqu5czAM1NiRZ9SHOxzFWwNqMNZ78h5AsIVsMKuqdMlsAa9NT23zEeeqhq0wyv6P9HeQT/h/GTgWypvyvGHMn80jlnBcPnaCLoSlXFOlSeeCdHzV4bPTVksXe6fg8RAht7ETZX41x2JEXePqvGFZTT8IK3tagDB+kAZyfKYJtDZb+QAGq0KPYEcnxzonPnNG5iXjp4+pb+y5oUdZgBbLeVOon2jJitG0aYwtM+j+1cLf88C3NTEauGA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.238) 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=jFHvo71J3QpKM0TZjVa4TOw0ewX69LaBlwjdTp5JjJQ=; b=M4QnNPTUQyrnC5Ujl6x++MbWoWoBYByfAGq+VcHG3QRBaJZZ3r0/d7S5lw4UiG6JiQAJ5/j29nT6yIr8dsoGPMT+NS1FKUJZwKOg5c3awLmfgJ2OQRb40ror7gSLhjs/7u+E8336aWzhz5jFjazOYN0WNFl7bqfwT121v6Gzm0SE1GtQ7M0lBSpFl4/KppAKytXsz0/aPTuowsupHRji4fOSJO0YOuHVyTfAwdev+SqSBctHcNng4p00vNnIgciN7U/+fLU5QVIcZ2j1GEhfjZtwsbPAmSy9OGPzJh1lub011UTLRB3ME+Y1HcmFJmbKw6iIy1vU3//5rUoLs23M1Q== Received: from BN7PR02CA0005.namprd02.prod.outlook.com (2603:10b6:408:20::18) by BN7PR12MB2756.namprd12.prod.outlook.com (2603:10b6:408:29::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.29; Tue, 12 Apr 2022 15:01:21 +0000 Received: from BN8NAM11FT068.eop-nam11.prod.protection.outlook.com (2603:10b6:408:20:cafe::d4) by BN7PR02CA0005.outlook.office365.com (2603:10b6:408:20::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5164.18 via Frontend Transport; Tue, 12 Apr 2022 15:01:21 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.238) 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.238 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.238; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.238) by BN8NAM11FT068.mail.protection.outlook.com (10.13.177.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5144.20 via Frontend Transport; Tue, 12 Apr 2022 15:01:20 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL105.nvidia.com (10.27.9.14) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Tue, 12 Apr 2022 15:01:12 +0000 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.22; Tue, 12 Apr 2022 08:01:10 -0700 From: Tal Shnaiderman To: CC: , Subject: [RFC PATCH 3/3] net/mlx5: support enhanced multi-packet write on Windows Date: Tue, 12 Apr 2022 18:00:00 +0300 Message-ID: <20220412150000.3412-4-talshn@nvidia.com> X-Mailer: git-send-email 2.16.1.windows.4 In-Reply-To: <20220412150000.3412-1-talshn@nvidia.com> References: <20220412150000.3412-1-talshn@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 97426704-2743-49f4-c5d6-08da1c954e02 X-MS-TrafficTypeDiagnostic: BN7PR12MB2756: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: 54eC4S3uCA6fwQyFvkmTfgG6MotDdowhbZPiVaF2w4IgkF3xUaN2Xs1/Po2jUIfSWlCYo5Gf17T5ICLbe4ATdBjYIy8RtdTmSHiiWdyLZ0SHGRe/IrddTkS022SlLyqlWmM8dDSkaghdr1FrBUgwwASKZqZxT2WLf5NMBtoIFDGH8VqQrGnPCwWQ4qJEOm4fvZcpdSsjLAMmPy4lM32Shwi5uBBFFDL8ubdetds3b1BS7WNwLl+5tVwAJ/Unz0jJmoeSssMCSe7k9WIS8InkfNFPrxGuJjRIm+4iVVxWN0G24RZfuWhpiYo1o1nAdIQ1mMvNftpabNJU+yMT+BDQ841xXPJfPvM7Pls/271Pd6suH5hjhOSTQppWBHnM8M7vuPeRzBgR7ONUrrpTcpOemRssfeLD0H4xaSMSPO6SwEXI8xo0Jzi7j/oxTF6+4twMLbbLXst8siknWH5ehEBmIgFaZYcBPxbjQaJXvvQyVpef86Ndh60Ff+FFvckfZ2Ad6stXkQn2zDyJoHLlDaEGhOyZq8Uvt9Sw7NT+5Fmb8Ga+VB2+oI4cW5hQhqL7Vlf6Ezsj2XUrfgD/CkoZuCFQ4EOSMS5P3X/r1VYxmiXzlEbKqmGxZYpWFqdLzDks4+fmu5z5vSQNwd09wipm+qUYMCN6XGfzUUA84jhpbGReB48bs+lDTpQK4LhM8pmY7h+PjChhFz0CIAOkTh3dLIPgzQ== X-Forefront-Antispam-Report: CIP:12.22.5.238; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(46966006)(40470700004)(36840700001)(70206006)(86362001)(2616005)(8676002)(7696005)(4326008)(70586007)(107886003)(6286002)(40460700003)(8936002)(508600001)(2906002)(5660300002)(82310400005)(6666004)(6916009)(26005)(16526019)(186003)(54906003)(336012)(83380400001)(426003)(47076005)(316002)(356005)(81166007)(1076003)(36860700001)(55016003)(36756003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Apr 2022 15:01:20.8980 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 97426704-2743-49f4-c5d6-08da1c954e02 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.238]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT068.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR12MB2756 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 Add support for enhanced multi-packet write on Windows. Enhanced multi-packet write allows the Tx burst function to pack up multiple packets in a single descriptor session to save PCI bandwidth and improve performance. The feature can be controlled by the txq_mpw_en PMD argument: txq_mpw_en=1 - PMD will first attempt to use "enhanced multi packet write" if the feature is not supported by the HW the legacy "multi packet write" will be used. if both are unsupported the multi packet write feature is disabled. txq_mpw_en=0 - multi packet write is disabled. txq_mpw_en unset(default) - enhanced multi packet write will be activated if supported. if unsupported the multi packet write feature is disabled. Signed-off-by: Tal Shnaiderman --- drivers/common/mlx5/mlx5_devx_cmds.c | 6 ++++++ drivers/common/mlx5/mlx5_devx_cmds.h | 2 ++ drivers/net/mlx5/windows/mlx5_os.c | 14 ++++++++++++-- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c b/drivers/common/mlx5/mlx5_devx_cmds.c index a109341d02..c6fc59dbbe 100644 --- a/drivers/common/mlx5/mlx5_devx_cmds.c +++ b/drivers/common/mlx5/mlx5_devx_cmds.c @@ -1119,6 +1119,12 @@ mlx5_devx_cmd_query_hca_attr(void *ctx, attr->rss_ind_tbl_cap = MLX5_GET (per_protocol_networking_offload_caps, hcattr, rss_ind_tbl_cap); + attr->multi_pkt_send_wqe = MLX5_GET + (per_protocol_networking_offload_caps, + hcattr, multi_pkt_send_wqe); + attr->enhanced_multi_pkt_send_wqe = MLX5_GET + (per_protocol_networking_offload_caps, + hcattr, enhanced_multi_pkt_send_wqe); /* Query HCA attribute for ROCE. */ if (attr->roce) { hcattr = mlx5_devx_get_hca_cap(ctx, in, out, &rc, diff --git a/drivers/common/mlx5/mlx5_devx_cmds.h b/drivers/common/mlx5/mlx5_devx_cmds.h index 6413176f2e..db6f1b2e71 100644 --- a/drivers/common/mlx5/mlx5_devx_cmds.h +++ b/drivers/common/mlx5/mlx5_devx_cmds.h @@ -259,6 +259,8 @@ struct mlx5_hca_attr { uint32_t striding_rq:1; uint32_t ext_stride_num_range:1; uint32_t cqe_compression_128:1; + uint32_t multi_pkt_send_wqe:1; + uint32_t enhanced_multi_pkt_send_wqe:1; }; /* LAG Context. */ diff --git a/drivers/net/mlx5/windows/mlx5_os.c b/drivers/net/mlx5/windows/mlx5_os.c index 232f22232b..a99f4ea183 100644 --- a/drivers/net/mlx5/windows/mlx5_os.c +++ b/drivers/net/mlx5/windows/mlx5_os.c @@ -173,8 +173,6 @@ mlx5_os_capabilities_prepare(struct mlx5_dev_ctx_shared *sh) sh->dev_cap.max_qp = 1 << hca_attr->log_max_qp; sh->dev_cap.max_qp_wr = 1 << hca_attr->log_max_qp_sz; sh->dev_cap.dv_flow_en = 1; - sh->dev_cap.mps = MLX5_MPW_DISABLED; - DRV_LOG(DEBUG, "MPW isn't supported."); DRV_LOG(DEBUG, "MPLS over GRE/UDP tunnel offloading is no supported."); sh->dev_cap.hw_csum = hca_attr->csum_cap; DRV_LOG(DEBUG, "Checksum offloading is %ssupported.", @@ -224,6 +222,18 @@ mlx5_os_capabilities_prepare(struct mlx5_dev_ctx_shared *sh) DRV_LOG(DEBUG, "Maximum Rx indirection table size is %u", sh->dev_cap.ind_table_max_size); } + if (hca_attr->enhanced_multi_pkt_send_wqe) { + sh->dev_cap.mps = MLX5_MPW_ENHANCED; + DRV_LOG(DEBUG, "Enhanced MPW is supported."); + } + else if (hca_attr->multi_pkt_send_wqe && + sh->dev_cap.mps != MLX5_ARG_UNSET) { + sh->dev_cap.mps = MLX5_MPW; + DRV_LOG(DEBUG, "MPW is supported."); + } else { + sh->dev_cap.mps = MLX5_MPW_DISABLED; + DRV_LOG(DEBUG, "MPW isn't supported."); + } sh->dev_cap.swp = mlx5_get_supported_sw_parsing_offloads(hca_attr); sh->dev_cap.tunnel_en = mlx5_get_supported_tunneling_offloads(hca_attr); if (sh->dev_cap.tunnel_en) { -- 2.16.1.windows.4