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 9507CA034F for ; Wed, 10 Nov 2021 07:48:55 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8E9D940142; Wed, 10 Nov 2021 07:48:55 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2073.outbound.protection.outlook.com [40.107.92.73]) by mails.dpdk.org (Postfix) with ESMTP id 31D1B40E03 for ; Wed, 10 Nov 2021 07:48:54 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HY6ZjmY2p3Cv5Py+kpZ/v7hypVQwujysFwxzXCXThpLPaukbOhfb0R7i9UmNK7jZXLPRgK3zTmRZu+AYph4dig4sw44gmVDsLeaDt8fg54HvPRVRoz3SmOT2z5mZq6CmlYzKjy/3CJQaEwu+55+gdKmaB7u9ajFkipY3Ybw58gB+LnF5PJWSkVtfty742URRXp4xqnwJl6xWNSjhWu3mbNCaRxYy5vskxuoIzmf3ucrlBcCVDkVYkYp0Xf+OdXkl+HRHnsc97Sh7E1rWFhaTZi2faR53sRcj6Lw+GXTyQrK6p6yMwpR+i53hWUd7TpaCnoFjULji5ovZrwhLekt9bQ== 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=+sBe83ed3W+TSzS0pZq/7K4inCUJA3vZdmeNUC9LaSk=; b=UOK9aswQJbAfMffcx4Gbsp0j5EUetXoYLj3XqfcEHwg0NYAlIXk8qO6HVwnYkIA9oPhv3jiUyofC8c3A/xxrMxdprWVmNWhMEhKo4WcWgQCbW9b9pGjbBZRLh1xOfr3RQvE3PWyDjskWXlmcFyZVP05u3vtrogRFQp7fqXSyyO+bS6bv9krrEe/DThOtTRLtW3X1MqI4H8XlxF6uXcdjaP9yKiBL7yD1gOUXR/jgpWQ4J4n/jCrScYFDFcpW8Cb7a+ogHdUf01MQJIfu/aTieKCUnjTN7yEyx9mejUZjYRE+XazQ+V/E74IGQ4VmgF1e8LFfuyPJONTWi6p3Lw+dwA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine 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=+sBe83ed3W+TSzS0pZq/7K4inCUJA3vZdmeNUC9LaSk=; b=TAxVKMbfwghI266f1/t2Fna61VF+0UoTZBqtLgd8JQZyYUck0ynr8CRL82vCkmmL05A5BtI9+MEvUAiBZzM33/YDj92PBMY1eiZfn6Xl9Sjc6WlCkLcUTxFWO3BiHt52jK99H16CysizG4c8NMHdepfsU6vI0k4fmeF466pmcqCf+OehSVzlXcTINChZ62e4PPmhzJtx88L8cQoWcefiOtF23/d5QHnmF7XE7ToH53Djk50gl/CdMGLbaV+TMH2Fk7NDksAZ+leNY3htSwsMYjOIXmqNEnBeaA9wy6EEpwIW/PUcL6FaB4cWn9bMaB6q2kTxzNY8K1WHA32j6JUqWw== Received: from BN6PR17CA0058.namprd17.prod.outlook.com (2603:10b6:405:75::47) by CH0PR12MB5252.namprd12.prod.outlook.com (2603:10b6:610:d3::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11; Wed, 10 Nov 2021 06:48:52 +0000 Received: from BN8NAM11FT017.eop-nam11.prod.protection.outlook.com (2603:10b6:405:75:cafe::77) by BN6PR17CA0058.outlook.office365.com (2603:10b6:405:75::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11 via Frontend Transport; Wed, 10 Nov 2021 06:48:52 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by BN8NAM11FT017.mail.protection.outlook.com (10.13.177.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 06:48:51 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 10 Nov 2021 06:48:49 +0000 From: Xueming Li To: Tal Shnaiderman CC: Luca Boccassi , Matan Azrad , "Idan Hackmon" , dpdk stable Date: Wed, 10 Nov 2021 14:30:33 +0800 Message-ID: <20211110063216.2744012-150-xuemingl@nvidia.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211110063216.2744012-1-xuemingl@nvidia.com> References: <20211110063216.2744012-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c5aca620-23f4-4c5c-899a-08d9a4162830 X-MS-TrafficTypeDiagnostic: CH0PR12MB5252: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mieLErenlIp8tvbkiJcyCXsZHPrCnb4KiDfrtggE3Q3FqGDOMVckDsuzCFqw6IYK8HWl97G3fceENI5azC4bdkaWRxsbvBSfRkFyzlbpNky0qFh/mZfHqAem9JHk3iWaWW4T+dKKt2qTP1veVWOt2DtUnFh0RfEKPuFjQN23dUqCnk7ZXifHl6mvowXvugP9xPMMsAT6k5BgDfke+ysyafqkCgtp8ERIzqU9l/tVi+3GEW4bDgrJzsCUESYkhGsQeDDKid4vw09k7s0l4eP3osWheQAHBvhx2A2mHs6bwerFedkOtrC1w8hutqLKZX8EYqkWIdEXJ65fPjEWwCNYXK95sD8XpNJhb++kuYQT+D78L1ns9CVhb6N5TJXWyEKsyfGydssRAmo1fzw4A5biyoKe1+zBi7UI5DBp3XNMI6icE9W1EXyI8WQzOAUaSlu6FNLQwjAS+3UsSrT+d4Bu8+PdFcZmpPFfD9QWJBIWOPMi/9cqsVSSm1fOqcbR5xQd5dtSGiLu9cArX0r/YcqS61dPX9FfzDCgoq8uzlZXvdB251GQHPtOGvnwhkU7gyfJnGPoT+lQOwTcFqi5v+r/YXZIRIkyynPp6+KL/OxzE0r/KN0+Gpi4pt+mfhiM6gwp6zYW6cXf3JWydvfEc74gcWW75F5UWzKZWwq7rF6J8CM0nmP+EVnUvP7OPIQ8tsdRKWsLy3Fskuw8IXZVprGj+tSGaOqQZOrTe+ileuLUj+UGbk7B5RHJ6cHBrIQ1X/EVE+F1T388zTqrKDeXEdDnrTHYf3zzHvMntL7LwZmxj78/ckatuiOrf2HOLUX6On2AZ4Dp5QGUR0aP+JH6A6WQy3kXO52RS9E6atgFQvbtCmo= X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(70206006)(4001150100001)(82310400003)(16526019)(508600001)(26005)(70586007)(37006003)(4326008)(36860700001)(53546011)(6666004)(54906003)(2906002)(966005)(356005)(36906005)(8936002)(186003)(47076005)(8676002)(55016002)(316002)(426003)(86362001)(336012)(7696005)(36756003)(6862004)(6636002)(1076003)(2616005)(6286002)(5660300002)(83380400001)(7636003)(309714004); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 06:48:51.8292 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c5aca620-23f4-4c5c-899a-08d9a4162830 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT017.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB5252 Subject: [dpdk-stable] patch 'net/mlx5: fix software parsing support query' has been queued to stable release 20.11.4 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/12/21. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/29a18f0f26e6d9597d415dba9d9b6f7960d23237 Thanks. Xueming Li --- >From 29a18f0f26e6d9597d415dba9d9b6f7960d23237 Mon Sep 17 00:00:00 2001 From: Tal Shnaiderman Date: Tue, 12 Oct 2021 15:45:42 +0300 Subject: [PATCH] net/mlx5: fix software parsing support query Cc: Xueming Li [ upstream commit accf3cfce4cb531bb1d5aceb1c1c84cc36ae9175 ] Currently, the PMD decides if the software parsing offload can enable outer IPv4 checksum and tunneled TSO support by checking config->hw_csum and config->tso respectively. This is incorrect, the right way is to check the following flags returned by the mlx5dv_query_device function: MLX5DV_SW_PARSING - check general swp support. MLX5DV_SW_PARSING_CSUM - check swp checksum support. MLX5DV_SW_PARSING_LSO - check swp LSO/TSO support. The fix enables the offloads according to the correct flags returned by the kernel. Fixes: e46821e9fcdc ("net/mlx5: separate generic tunnel TSO from the standard one") Signed-off-by: Tal Shnaiderman Acked-by: Matan Azrad Tested-by: Idan Hackmon --- drivers/net/mlx5/linux/mlx5_os.c | 3 ++- drivers/net/mlx5/linux/mlx5_os.h | 12 ++++++++++++ drivers/net/mlx5/mlx5.h | 2 +- drivers/net/mlx5/mlx5_txq.c | 15 +++++++++------ 4 files changed, 24 insertions(+), 8 deletions(-) diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c index 04700fcbeb..714feba36e 100644 --- a/drivers/net/mlx5/linux/mlx5_os.c +++ b/drivers/net/mlx5/linux/mlx5_os.c @@ -916,7 +916,8 @@ err_secondary: swp = dv_attr.sw_parsing_caps.sw_parsing_offloads; DRV_LOG(DEBUG, "SWP support: %u", swp); #endif - config->swp = !!swp; + config->swp = swp & (MLX5_SW_PARSING_CAP | MLX5_SW_PARSING_CSUM_CAP | + MLX5_SW_PARSING_TSO_CAP); #ifdef HAVE_IBV_DEVICE_STRIDING_RQ_SUPPORT if (dv_attr.comp_mask & MLX5DV_CONTEXT_MASK_STRIDING_RQ) { struct mlx5dv_striding_rq_caps mprq_caps = diff --git a/drivers/net/mlx5/linux/mlx5_os.h b/drivers/net/mlx5/linux/mlx5_os.h index 7dbacceabe..d9d464b5e3 100644 --- a/drivers/net/mlx5/linux/mlx5_os.h +++ b/drivers/net/mlx5/linux/mlx5_os.h @@ -19,4 +19,16 @@ enum { #define PCI_DRV_FLAGS (RTE_PCI_DRV_INTR_LSC | \ RTE_PCI_DRV_INTR_RMV | \ RTE_PCI_DRV_PROBE_AGAIN) + +enum mlx5_sw_parsing_offloads { +#ifdef HAVE_IBV_MLX5_MOD_SWP + MLX5_SW_PARSING_CAP = MLX5DV_SW_PARSING, + MLX5_SW_PARSING_CSUM_CAP = MLX5DV_SW_PARSING_CSUM, + MLX5_SW_PARSING_TSO_CAP = MLX5DV_SW_PARSING_LSO, +#else + MLX5_SW_PARSING_CAP = 0, + MLX5_SW_PARSING_CSUM_CAP = 0, + MLX5_SW_PARSING_TSO_CAP = 0, +#endif +}; #endif /* RTE_PMD_MLX5_OS_H_ */ diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index 69eda27a0f..9c8991aba6 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -218,7 +218,7 @@ struct mlx5_dev_config { unsigned int dv_xmeta_en:2; /* Enable extensive flow metadata. */ unsigned int lacp_by_user:1; /* Enable user to manage LACP traffic. */ - unsigned int swp:1; /* Tx generic tunnel checksum and TSO offload. */ + unsigned int swp:3; /* Tx generic tunnel checksum and TSO offload. */ unsigned int devx:1; /* Whether devx interface is available or not. */ unsigned int dest_tir:1; /* Whether advanced DR API is available. */ unsigned int reclaim_mode:2; /* Memory reclaim mode. */ diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c index 9ec7b57f1c..1354cc9619 100644 --- a/drivers/net/mlx5/mlx5_txq.c +++ b/drivers/net/mlx5/mlx5_txq.c @@ -109,9 +109,9 @@ mlx5_get_tx_port_offloads(struct rte_eth_dev *dev) if (config->tx_pp) offloads |= DEV_TX_OFFLOAD_SEND_ON_TIMESTAMP; if (config->swp) { - if (config->hw_csum) + if (config->swp & MLX5_SW_PARSING_CSUM_CAP) offloads |= DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM; - if (config->tso) + if (config->swp & MLX5_SW_PARSING_TSO_CAP) offloads |= (DEV_TX_OFFLOAD_IP_TNL_TSO | DEV_TX_OFFLOAD_UDP_TNL_TSO); } @@ -971,10 +971,13 @@ txq_set_params(struct mlx5_txq_ctrl *txq_ctrl) txq_ctrl->txq.tso_en = 1; } txq_ctrl->txq.tunnel_en = config->tunnel_en | config->swp; - txq_ctrl->txq.swp_en = ((DEV_TX_OFFLOAD_IP_TNL_TSO | - DEV_TX_OFFLOAD_UDP_TNL_TSO | - DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM) & - txq_ctrl->txq.offloads) && config->swp; + txq_ctrl->txq.swp_en = (((DEV_TX_OFFLOAD_IP_TNL_TSO | + DEV_TX_OFFLOAD_UDP_TNL_TSO) & + txq_ctrl->txq.offloads) && (config->swp & + MLX5_SW_PARSING_TSO_CAP)) | + ((DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM & + txq_ctrl->txq.offloads) && (config->swp & + MLX5_SW_PARSING_CSUM_CAP)); } /** -- 2.33.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-10 14:17:08.562122974 +0800 +++ 0149-net-mlx5-fix-software-parsing-support-query.patch 2021-11-10 14:17:01.937412212 +0800 @@ -1 +1 @@ -From accf3cfce4cb531bb1d5aceb1c1c84cc36ae9175 Mon Sep 17 00:00:00 2001 +From 29a18f0f26e6d9597d415dba9d9b6f7960d23237 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit accf3cfce4cb531bb1d5aceb1c1c84cc36ae9175 ] @@ -22 +24,0 @@ -Cc: stable@dpdk.org @@ -35 +37 @@ -index 0dcf5000e9..e08082ed70 100644 +index 04700fcbeb..714feba36e 100644 @@ -38 +40 @@ -@@ -1111,7 +1111,8 @@ err_secondary: +@@ -916,7 +916,8 @@ err_secondary: @@ -49 +51 @@ -index 2991d37df2..da036edb72 100644 +index 7dbacceabe..d9d464b5e3 100644 @@ -52,4 +54,4 @@ -@@ -21,4 +21,16 @@ enum { - - int mlx5_auxiliary_get_ifindex(const char *sf_name); - +@@ -19,4 +19,16 @@ enum { + #define PCI_DRV_FLAGS (RTE_PCI_DRV_INTR_LSC | \ + RTE_PCI_DRV_INTR_RMV | \ + RTE_PCI_DRV_PROBE_AGAIN) @@ -70 +72 @@ -index 6811b8bd35..d74ac19cf8 100644 +index 69eda27a0f..9c8991aba6 100644 @@ -73 +75 @@ -@@ -267,7 +267,7 @@ struct mlx5_dev_config { +@@ -218,7 +218,7 @@ struct mlx5_dev_config { @@ -83 +85 @@ -index 92fbdab568..eb26367827 100644 +index 9ec7b57f1c..1354cc9619 100644 @@ -86 +88 @@ -@@ -111,9 +111,9 @@ mlx5_get_tx_port_offloads(struct rte_eth_dev *dev) +@@ -109,9 +109,9 @@ mlx5_get_tx_port_offloads(struct rte_eth_dev *dev) @@ -98 +100 @@ -@@ -972,10 +972,13 @@ txq_set_params(struct mlx5_txq_ctrl *txq_ctrl) +@@ -971,10 +971,13 @@ txq_set_params(struct mlx5_txq_ctrl *txq_ctrl)