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 DE1C243CE7 for ; Mon, 18 Mar 2024 16:40:10 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D699F40289; Mon, 18 Mar 2024 16:40:10 +0100 (CET) Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) by mails.dpdk.org (Postfix) with ESMTP id 6D16540289 for ; Mon, 18 Mar 2024 16:40:09 +0100 (CET) Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-41412411672so6871075e9.3 for ; Mon, 18 Mar 2024 08:40:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710776409; x=1711381209; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZVzjL/97KwBAA7HM173jUmrbth4p8blh1lNlPgPcCVE=; b=YvxWmvdLrLcu8ykomT9XJOaOt+fbJ2VZMVFzOO7QbNV/giu4AwZhnmFohkaLgCvuQ+ txeZsms7sLGIOA1TGR2ORqrgrQdTYoHUtqpiRWP7s+IQ2QwMft+vKjeaK3mIl4ntnCnk +MlNDlxPrdwEfDK3FY0W5t3TTRNsqfyxjaNwai5h3CHB+D10jDzqY1T2VUudNpz9cgQC A8B+LKNUCVPWQ0s9MaTtfIQ/DiWI+n2bO6afBdJ2+7IOwsQXge4H3+2rocbuQo8Svgp9 xzuNyN8r2H8k4nug+7QAKmAOIBoZVPJzhqkflib16uNqdSGDT+qw8VRPPYQ/YvmlN17e 55vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710776409; x=1711381209; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZVzjL/97KwBAA7HM173jUmrbth4p8blh1lNlPgPcCVE=; b=syDs9KJyGpcjcvN48GaBd+vdzt8oW9FNfOhqSfLxWTlBt7VSg2BVz3GY9anEHUOAo1 QulK6A7Xrsdv2o3VDonwzNIn19vMUN43k74l15vvE7uwfrEteNCWPBEToAL7mdHrJYHt ME1+TTjtNDVs8QmOBbyovBlnf8Z0/PKSJNx5AAbr2vH0I0WqcIdReXjmpWZADb1OsU6d TJNHuBKdPrNs61j0PFI1RVJuE6M1GAQGs6tDsPndGyG+F3n3Nt/rqqR/f2dm9PXy9FrY w20BFl+bces7CL/9r1PkjgTZ7CZ9sII2ISNkYO5+Nhr3vaWuOX+CYmkee+L7r3QjecYV W08Q== X-Forwarded-Encrypted: i=1; AJvYcCUNEF6Z+LXpR0tTKCZlpL4Fdu/epnI9AvHuTjSgyqSJL3Gu0/nwip3iHCMUuN1xNdpWXz1N6sBbmE0evcUXojs= X-Gm-Message-State: AOJu0Yx6ufMTL/PGWRpspajAdu+Clh15YLbSab/faq40juzRC1HIbsQ7 JOa7SOwzBrC5hmAhvjfgbyn4V4FaUsv2nGoYW5+NOq9762ATSooqAdXfEomme6k= X-Google-Smtp-Source: AGHT+IFjGI0N77NORUkxZmPc7JLt+EFGHGlMLXDRtRjqimHs/52rLUQ/jxMcZl/+mblR67xZ9KO6+g== X-Received: by 2002:adf:e282:0:b0:341:8083:b2a3 with SMTP id v2-20020adfe282000000b003418083b2a3mr924026wri.30.1710776409030; Mon, 18 Mar 2024 08:40:09 -0700 (PDT) Received: from localhost ([137.220.120.171]) by smtp.gmail.com with ESMTPSA id j16-20020adfe510000000b0033e42ab5114sm10144565wrm.2.2024.03.18.08.40.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Mar 2024 08:40:08 -0700 (PDT) From: luca.boccassi@gmail.com To: Gregory Etelson Cc: Dariusz Sosnowski , dpdk stable Subject: patch 'net/mlx5: fix HWS meter actions availability' has been queued to stable release 22.11.5 Date: Mon, 18 Mar 2024 15:39:05 +0000 Message-Id: <20240318153919.3407921-15-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240318153919.3407921-1-luca.boccassi@gmail.com> References: <20240314000957.2810803-61-luca.boccassi@gmail.com> <20240318153919.3407921-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 22.11.5 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/20/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://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/ec91ab121a6b8afee9e2d49bbecc44f89ac18296 Thanks. Luca Boccassi --- >From ec91ab121a6b8afee9e2d49bbecc44f89ac18296 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 [ 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 08f8aad70a..bcaf518227 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. * @@ -707,6 +708,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. @@ -849,6 +851,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 * @@ -885,6 +888,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, @@ -1211,6 +1215,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. * @@ -1547,7 +1552,7 @@ policy_add_err: RTE_MTR_ERROR_TYPE_UNSPECIFIED, NULL, "Failed to create meter policy."); } - +#endif /** * Check meter validation. * @@ -1915,6 +1920,7 @@ error: NULL, "Failed to create devx meter."); } +#if defined(HAVE_MLX5_HWS_SUPPORT) /** * Create meter rules. * @@ -1998,6 +2004,7 @@ mlx5_flow_meter_hws_create(struct rte_eth_dev *dev, uint32_t meter_id, __atomic_add_fetch(&policy->ref_cnt, 1, __ATOMIC_RELAXED); return 0; } +#endif static int mlx5_flow_meter_params_flush(struct rte_eth_dev *dev, @@ -2482,6 +2489,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, @@ -2500,6 +2508,7 @@ static const struct rte_mtr_ops mlx5_flow_mtr_hws_ops = { .stats_update = NULL, .stats_read = NULL, }; +#endif /** * Get meter operations. @@ -2515,12 +2524,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; } @@ -2899,7 +2912,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; @@ -2967,15 +2979,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; @@ -2989,14 +3006,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.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-03-18 12:58:39.884620038 +0000 +++ 0015-net-mlx5-fix-HWS-meter-actions-availability.patch 2024-03-18 12:58:39.127345106 +0000 @@ -1 +1 @@ -From 7576c32eefd3b8444cff7f946361fb5c074634a7 Mon Sep 17 00:00:00 2001 +From ec91ab121a6b8afee9e2d49bbecc44f89ac18296 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 7576c32eefd3b8444cff7f946361fb5c074634a7 ] + @@ -10 +11,0 @@ -Cc: stable@dpdk.org @@ -19 +20 @@ -index c0578ce6e9..57de95b4b9 100644 +index 08f8aad70a..bcaf518227 100644 @@ -22 +23 @@ -@@ -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 +31 @@ -@@ -981,6 +982,7 @@ mlx5_flow_meter_profile_hws_delete(struct rte_eth_dev *dev, +@@ -707,6 +708,7 @@ mlx5_flow_meter_profile_hws_delete(struct rte_eth_dev *dev, @@ -38 +39 @@ -@@ -1123,6 +1125,7 @@ mlx5_flow_meter_policy_validate(struct rte_eth_dev *dev, +@@ -849,6 +851,7 @@ mlx5_flow_meter_policy_validate(struct rte_eth_dev *dev, @@ -46 +47 @@ -@@ -1159,6 +1162,7 @@ mlx5_flow_meter_policy_hws_validate(struct rte_eth_dev *dev, +@@ -885,6 +888,7 @@ mlx5_flow_meter_policy_hws_validate(struct rte_eth_dev *dev, @@ -54 +55 @@ -@@ -1485,6 +1489,7 @@ mlx5_flow_meter_policy_get(struct rte_eth_dev *dev, +@@ -1211,6 +1215,7 @@ mlx5_flow_meter_policy_get(struct rte_eth_dev *dev, @@ -62 +63 @@ -@@ -1807,7 +1812,7 @@ policy_add_err: +@@ -1547,7 +1552,7 @@ policy_add_err: @@ -71 +72 @@ -@@ -2177,6 +2182,7 @@ error: +@@ -1915,6 +1920,7 @@ error: @@ -79,2 +80,2 @@ -@@ -2260,6 +2266,7 @@ mlx5_flow_meter_hws_create(struct rte_eth_dev *dev, uint32_t meter_id, - __atomic_fetch_add(&policy->ref_cnt, 1, __ATOMIC_RELAXED); +@@ -1998,6 +2004,7 @@ mlx5_flow_meter_hws_create(struct rte_eth_dev *dev, uint32_t meter_id, + __atomic_add_fetch(&policy->ref_cnt, 1, __ATOMIC_RELAXED); @@ -87 +88 @@ -@@ -2744,6 +2751,7 @@ static const struct rte_mtr_ops mlx5_flow_mtr_ops = { +@@ -2482,6 +2489,7 @@ static const struct rte_mtr_ops mlx5_flow_mtr_ops = { @@ -95 +96 @@ -@@ -2762,6 +2770,7 @@ static const struct rte_mtr_ops mlx5_flow_mtr_hws_ops = { +@@ -2500,6 +2508,7 @@ static const struct rte_mtr_ops mlx5_flow_mtr_hws_ops = { @@ -103 +104 @@ -@@ -2777,12 +2786,16 @@ static const struct rte_mtr_ops mlx5_flow_mtr_hws_ops = { +@@ -2515,12 +2524,16 @@ static const struct rte_mtr_ops mlx5_flow_mtr_hws_ops = { @@ -120 +121 @@ -@@ -3161,7 +3174,6 @@ mlx5_flow_meter_flush(struct rte_eth_dev *dev, struct rte_mtr_error *error) +@@ -2899,7 +2912,6 @@ mlx5_flow_meter_flush(struct rte_eth_dev *dev, struct rte_mtr_error *error) @@ -128 +129 @@ -@@ -3229,15 +3241,20 @@ mlx5_flow_meter_flush(struct rte_eth_dev *dev, struct rte_mtr_error *error) +@@ -2967,15 +2979,20 @@ mlx5_flow_meter_flush(struct rte_eth_dev *dev, struct rte_mtr_error *error) @@ -150 +151 @@ -@@ -3251,14 +3268,17 @@ mlx5_flow_meter_flush(struct rte_eth_dev *dev, struct rte_mtr_error *error) +@@ -2989,14 +3006,17 @@ mlx5_flow_meter_flush(struct rte_eth_dev *dev, struct rte_mtr_error *error)