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 CB69543E57 for ; Sat, 13 Apr 2024 14:58:44 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C607D40A72; Sat, 13 Apr 2024 14:58:44 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2082.outbound.protection.outlook.com [40.107.243.82]) by mails.dpdk.org (Postfix) with ESMTP id 0FC02400D6 for ; Sat, 13 Apr 2024 14:58:43 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QG04b2yjMlqWKh8LSRkIKL7yOBUuTVGuBKlIwCY6n0t52gjSh/KWskqtcal8h18tyeBEtPYY6AMO7MpDmfy4B7Y6F4a8wQOL/Lley9QbYq7XWP7wKLlzZA0w6lUbRxrNBW1cs6qxhyT7OckXPtoR/tPnyWQlTu/up54e33rGukOsEPmZdAXzSrLG7dR35xwn0whubJLs2/83+MXqNHi0ehVv/8UM55IDnI08sP4Du1gc5z4skI5ISRuyY/fnaO/oK9Q29BF9yrzz0u2XEMa10exSPiF7+/TmO6CbmCDEU7RHAKXMDYN5dfJ5SlAKDkfjX/m1liEY+RgK1GbfHLokpA== 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=naWqjoX1SWATc/JwKu+AKlEwAYRAZI2zQ66Gd6FwSKw=; b=nB6LoyBkLQQTK9yCd2LWtXl15aDpwzTQOWiwbcj+TNVE8vOP2vyeQ17PjVMzfsxUTI+Mts9YL6r/ltdujQtRoC1wpwBW3o2+frwK43vodm96mfpYoM+vRDrn1wGTMxct1/eUKSwJZlKPOuaAljjoHzjVJDjQaCQqzWaUSeJDzGWJdYMLjgnhs0S3GIpoojI5QaCfMQy84Y5h1fQAov19UDQ5WqE42imzUyNC5+v23/KkvO3U9QeJ/5N7dz4f184fBpRZMjN0DnC2/jB/GQGNK8m35phWhKYCK/BmqIP1fq20v0eXdnyeYaif+vqccNNC0jzqqtb/XbkgBs9Eh4SdVg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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 (0) 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=naWqjoX1SWATc/JwKu+AKlEwAYRAZI2zQ66Gd6FwSKw=; b=s15wqXVuN3o9IK5IeNWnP6ETcHHJtteQ1BS1fnRw6/gRBTfu4gtjjRw1FY3ijZ3o0kvO4eRqlstqBMlOa7q8Ol+EPJCX+KNPoCE+YUZT3Mj0KksGVm1UmA1ugX9T+3FyvGqLw1yGiP8tBo03TxFth4V76/3ar2gXcLUKAxmRCsQyHyYotWV9A+8GLG40UMmldqfrXZSRAF7GLgfCuYl6a10Mm2ff7li3TgHQ1f9bjMldeCS2sH9mX7gyEwfpwvIvWiGCd2JZqGrPaI9gPY2LtLxve44nnewM6WzK6cNsaa7AZwrISSokeS8JZAau+6PoZiUCSwSOj15Kbid3ng6QCg== Received: from SJ0PR13CA0104.namprd13.prod.outlook.com (2603:10b6:a03:2c5::19) by MW6PR12MB7085.namprd12.prod.outlook.com (2603:10b6:303:238::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.55; Sat, 13 Apr 2024 12:58:39 +0000 Received: from MWH0EPF000A6731.namprd04.prod.outlook.com (2603:10b6:a03:2c5:cafe::eb) by SJ0PR13CA0104.outlook.office365.com (2603:10b6:a03:2c5::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7495.16 via Frontend Transport; Sat, 13 Apr 2024 12:58:39 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by MWH0EPF000A6731.mail.protection.outlook.com (10.167.249.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.22 via Frontend Transport; Sat, 13 Apr 2024 12:58:39 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Sat, 13 Apr 2024 05:58:29 -0700 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.1258.12; Sat, 13 Apr 2024 05:58:27 -0700 From: Xueming Li To: Gregory Etelson CC: Dariusz Sosnowski , dpdk stable Subject: patch 'net/mlx5: fix HWS meter actions availability' has been queued to stable release 23.11.1 Date: Sat, 13 Apr 2024 20:49:32 +0800 Message-ID: <20240413125005.725659-92-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240413125005.725659-1-xuemingl@nvidia.com> References: <20240305094757.439387-1-xuemingl@nvidia.com> <20240413125005.725659-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] 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: MWH0EPF000A6731:EE_|MW6PR12MB7085:EE_ X-MS-Office365-Filtering-Correlation-Id: 0adc02b1-c53c-45fb-0b02-08dc5bb97086 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MvDFBGVTRzzGucliAHFXLM6p1yUNEJcMREVJRTNolb+fn8HTJ/GQIDTpSjgFwitu1JNly8oNTgmRJ2N60g78+2PyEpRN7CcShQlB/WJYDSeylxLyB9d7OFh2TXaIa7OLlfWalyBq/SJn+pupd7BwkC2hKiw/imY5iTNwiBi79+q6r7/g7IgIbzDmIGcvAU0//DpQLgL/3/WwuoRR14qtnvbpeuA28m8PfKVXxoKdusEFHKQy5pO0rvB0wG05hj/4iSov5EY/EX3C+csDNS9D4xre4JO2MNM6sHHH7iZZNsUO/b7QIpChtKCa9sBF1LZ/QEEv3Sqj2newbDjMtx+ark1sgdEgc3CHj4j2LD31lYgHeF7tKSjujReAQaoPLthsOd0XWKA4fG+0ASAMOv4Kt8+e9IDXNsYfJTyfstyCz2/yRxiJR0kD3HH6zPfj1dA2zB1P5TSRSabftLxTW3PbUvza3qAet5imE1tCCy8NvZIRPTxzOU3EE0Jq3YsycU+OWE8lLl8JospIT8FZzQBPvcqdoRscDqUsC+Z62NzTnU0vP08M9wvxuKSgeYok6zymc2kqUTeZU6VjQmDun10uyuQ2qgOiIpGsoeURICQbt3LDKrxgJMCmtCdN8c1SW4JF5pu0b2Vts789zhvkyAS7oBimAjrHz9/c8dwEXsWDG6qfcLUuplTjdl/YXWBMiCLdfZ8enqaC5ZbgNOyAmbQjlsJ8DeYZ0SOsqW6HXGjpjUKDLuzOr1AdABsjcTmqP4od X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230031)(1800799015)(82310400014)(376005)(36860700004); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2024 12:58:39.3896 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0adc02b1-c53c-45fb-0b02-08dc5bb97086 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.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: MWH0EPF000A6731.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR12MB7085 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 Hi, FYI, your patch has been queued to stable release 23.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 04/15/24. 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://git.dpdk.org/dpdk-stable/log/?h=23.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=50eb03f8d3302810ac2d966cff17dd1be6549bd7 Thanks. Xueming Li --- >From 50eb03f8d3302810ac2d966cff17dd1be6549bd7 Mon Sep 17 00:00:00 2001 From: Gregory Etelson Date: Thu, 7 Mar 2024 12:19:08 +0200 Subject: [PATCH] net/mlx5: fix HWS meter actions availability Cc: Xueming Li [ upstream commit 7576c32eefd3b8444cff7f946361fb5c074634a7 ] Allow compilation of HWS meter code only on platforms that support HWS. Fixes: 24865366e495 ("net/mlx5: support flow meter action for HWS") Signed-off-by: Gregory Etelson Acked-by: Dariusz Sosnowski --- drivers/net/mlx5/mlx5_flow_meter.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_meter.c b/drivers/net/mlx5/mlx5_flow_meter.c index 7cbf772ea4..beeb868c8c 100644 --- a/drivers/net/mlx5/mlx5_flow_meter.c +++ b/drivers/net/mlx5/mlx5_flow_meter.c @@ -618,6 +618,7 @@ mlx5_flow_meter_profile_get(struct rte_eth_dev *dev, meter_profile_id); } +#if defined(HAVE_MLX5_HWS_SUPPORT) /** * Callback to add MTR profile with HWS. * @@ -697,6 +698,7 @@ mlx5_flow_meter_profile_hws_delete(struct rte_eth_dev *dev, memset(fmp, 0, sizeof(struct mlx5_flow_meter_profile)); return 0; } +#endif /** * Find policy by id. @@ -839,6 +841,7 @@ mlx5_flow_meter_policy_validate(struct rte_eth_dev *dev, return 0; } +#if defined(HAVE_MLX5_HWS_SUPPORT) /** * Callback to check MTR policy action validate for HWS * @@ -875,6 +878,7 @@ mlx5_flow_meter_policy_hws_validate(struct rte_eth_dev *dev, } return 0; } +#endif static int __mlx5_flow_meter_policy_delete(struct rte_eth_dev *dev, @@ -1201,6 +1205,7 @@ mlx5_flow_meter_policy_get(struct rte_eth_dev *dev, &policy_idx); } +#if defined(HAVE_MLX5_HWS_SUPPORT) /** * Callback to delete MTR policy for HWS. * @@ -1523,7 +1528,7 @@ policy_add_err: RTE_MTR_ERROR_TYPE_UNSPECIFIED, NULL, "Failed to create meter policy."); } - +#endif /** * Check meter validation. * @@ -1893,6 +1898,7 @@ error: NULL, "Failed to create devx meter."); } +#if defined(HAVE_MLX5_HWS_SUPPORT) /** * Create meter rules. * @@ -1976,6 +1982,7 @@ mlx5_flow_meter_hws_create(struct rte_eth_dev *dev, uint32_t meter_id, __atomic_fetch_add(&policy->ref_cnt, 1, __ATOMIC_RELAXED); return 0; } +#endif static int mlx5_flow_meter_params_flush(struct rte_eth_dev *dev, @@ -2460,6 +2467,7 @@ static const struct rte_mtr_ops mlx5_flow_mtr_ops = { .stats_read = mlx5_flow_meter_stats_read, }; +#if defined(HAVE_MLX5_HWS_SUPPORT) static const struct rte_mtr_ops mlx5_flow_mtr_hws_ops = { .capabilities_get = mlx5_flow_mtr_cap_get, .meter_profile_add = mlx5_flow_meter_profile_hws_add, @@ -2478,6 +2486,7 @@ static const struct rte_mtr_ops mlx5_flow_mtr_hws_ops = { .stats_update = NULL, .stats_read = NULL, }; +#endif /** * Get meter operations. @@ -2493,12 +2502,16 @@ static const struct rte_mtr_ops mlx5_flow_mtr_hws_ops = { int mlx5_flow_meter_ops_get(struct rte_eth_dev *dev __rte_unused, void *arg) { +#if defined(HAVE_MLX5_HWS_SUPPORT) struct mlx5_priv *priv = dev->data->dev_private; if (priv->sh->config.dv_flow_en == 2) *(const struct rte_mtr_ops **)arg = &mlx5_flow_mtr_hws_ops; else *(const struct rte_mtr_ops **)arg = &mlx5_flow_mtr_ops; +#else + *(const struct rte_mtr_ops **)arg = &mlx5_flow_mtr_ops; +#endif return 0; } @@ -2877,7 +2890,6 @@ mlx5_flow_meter_flush(struct rte_eth_dev *dev, struct rte_mtr_error *error) struct mlx5_flow_meter_profile *fmp; struct mlx5_legacy_flow_meter *legacy_fm; struct mlx5_flow_meter_info *fm; - struct mlx5_flow_meter_policy *policy; struct mlx5_flow_meter_sub_policy *sub_policy; void *tmp; uint32_t i, mtr_idx, policy_idx; @@ -2945,15 +2957,20 @@ mlx5_flow_meter_flush(struct rte_eth_dev *dev, struct rte_mtr_error *error) mlx5_l3t_destroy(priv->policy_idx_tbl); priv->policy_idx_tbl = NULL; } +#if defined(HAVE_MLX5_HWS_SUPPORT) if (priv->mtr_policy_arr) { + struct mlx5_flow_meter_policy *policy; + for (i = 0; i < priv->mtr_config.nb_meter_policies; i++) { policy = mlx5_flow_meter_policy_find(dev, i, &policy_idx); - if (policy->initialized) + if (policy->initialized) { mlx5_flow_meter_policy_hws_delete(dev, i, error); + } } } +#endif if (priv->mtr_profile_tbl) { MLX5_L3T_FOREACH(priv->mtr_profile_tbl, i, entry) { fmp = entry; @@ -2967,14 +2984,17 @@ mlx5_flow_meter_flush(struct rte_eth_dev *dev, struct rte_mtr_error *error) mlx5_l3t_destroy(priv->mtr_profile_tbl); priv->mtr_profile_tbl = NULL; } +#if defined(HAVE_MLX5_HWS_SUPPORT) if (priv->mtr_profile_arr) { for (i = 0; i < priv->mtr_config.nb_meter_profiles; i++) { fmp = mlx5_flow_meter_profile_find(priv, i); - if (fmp->initialized) + if (fmp->initialized) { mlx5_flow_meter_profile_hws_delete(dev, i, error); + } } } +#endif /* Delete default policy table. */ mlx5_flow_destroy_def_policy(dev); if (priv->sh->refcnt == 1) -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-04-13 20:43:07.817311049 +0800 +++ 0092-net-mlx5-fix-HWS-meter-actions-availability.patch 2024-04-13 20:43:05.047753866 +0800 @@ -1 +1 @@ -From 7576c32eefd3b8444cff7f946361fb5c074634a7 Mon Sep 17 00:00:00 2001 +From 50eb03f8d3302810ac2d966cff17dd1be6549bd7 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 7576c32eefd3b8444cff7f946361fb5c074634a7 ] @@ -10 +12,0 @@ -Cc: stable@dpdk.org @@ -19 +21 @@ -index c0578ce6e9..57de95b4b9 100644 +index 7cbf772ea4..beeb868c8c 100644 @@ -22 +24 @@ -@@ -896,6 +896,7 @@ mlx5_flow_meter_profile_get(struct rte_eth_dev *dev, +@@ -618,6 +618,7 @@ mlx5_flow_meter_profile_get(struct rte_eth_dev *dev, @@ -30 +32 @@ -@@ -981,6 +982,7 @@ mlx5_flow_meter_profile_hws_delete(struct rte_eth_dev *dev, +@@ -697,6 +698,7 @@ mlx5_flow_meter_profile_hws_delete(struct rte_eth_dev *dev, @@ -38 +40 @@ -@@ -1123,6 +1125,7 @@ mlx5_flow_meter_policy_validate(struct rte_eth_dev *dev, +@@ -839,6 +841,7 @@ mlx5_flow_meter_policy_validate(struct rte_eth_dev *dev, @@ -46 +48 @@ -@@ -1159,6 +1162,7 @@ mlx5_flow_meter_policy_hws_validate(struct rte_eth_dev *dev, +@@ -875,6 +878,7 @@ mlx5_flow_meter_policy_hws_validate(struct rte_eth_dev *dev, @@ -54 +56 @@ -@@ -1485,6 +1489,7 @@ mlx5_flow_meter_policy_get(struct rte_eth_dev *dev, +@@ -1201,6 +1205,7 @@ mlx5_flow_meter_policy_get(struct rte_eth_dev *dev, @@ -62 +64 @@ -@@ -1807,7 +1812,7 @@ policy_add_err: +@@ -1523,7 +1528,7 @@ policy_add_err: @@ -71 +73 @@ -@@ -2177,6 +2182,7 @@ error: +@@ -1893,6 +1898,7 @@ error: @@ -79 +81 @@ -@@ -2260,6 +2266,7 @@ mlx5_flow_meter_hws_create(struct rte_eth_dev *dev, uint32_t meter_id, +@@ -1976,6 +1982,7 @@ mlx5_flow_meter_hws_create(struct rte_eth_dev *dev, uint32_t meter_id, @@ -87 +89 @@ -@@ -2744,6 +2751,7 @@ static const struct rte_mtr_ops mlx5_flow_mtr_ops = { +@@ -2460,6 +2467,7 @@ static const struct rte_mtr_ops mlx5_flow_mtr_ops = { @@ -95 +97 @@ -@@ -2762,6 +2770,7 @@ static const struct rte_mtr_ops mlx5_flow_mtr_hws_ops = { +@@ -2478,6 +2486,7 @@ static const struct rte_mtr_ops mlx5_flow_mtr_hws_ops = { @@ -103 +105 @@ -@@ -2777,12 +2786,16 @@ static const struct rte_mtr_ops mlx5_flow_mtr_hws_ops = { +@@ -2493,12 +2502,16 @@ static const struct rte_mtr_ops mlx5_flow_mtr_hws_ops = { @@ -120 +122 @@ -@@ -3161,7 +3174,6 @@ mlx5_flow_meter_flush(struct rte_eth_dev *dev, struct rte_mtr_error *error) +@@ -2877,7 +2890,6 @@ mlx5_flow_meter_flush(struct rte_eth_dev *dev, struct rte_mtr_error *error) @@ -128 +130 @@ -@@ -3229,15 +3241,20 @@ mlx5_flow_meter_flush(struct rte_eth_dev *dev, struct rte_mtr_error *error) +@@ -2945,15 +2957,20 @@ mlx5_flow_meter_flush(struct rte_eth_dev *dev, struct rte_mtr_error *error) @@ -150 +152 @@ -@@ -3251,14 +3268,17 @@ mlx5_flow_meter_flush(struct rte_eth_dev *dev, struct rte_mtr_error *error) +@@ -2967,14 +2984,17 @@ mlx5_flow_meter_flush(struct rte_eth_dev *dev, struct rte_mtr_error *error)