patch 'net/mlx5: fix HWS meter actions availability' has been queued to stable release 22.11.5

luca.boccassi at gmail.com luca.boccassi at gmail.com
Mon Mar 18 16:39:05 CET 2024


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 <getelson at nvidia.com>
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 <getelson at nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski at nvidia.com>
---
 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 at 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)


More information about the stable mailing list