patch 'net/mlx5: fix error set in Tx representor tagging' has been queued to stable release 22.11.3

Xueming Li xuemingl at nvidia.com
Thu Aug 10 01:58:53 CEST 2023


Hi,

FYI, your patch has been queued to stable release 22.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/11/23. 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=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=0a632c40ee7dcbfc4688c7e52cc54a353e290050

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 0a632c40ee7dcbfc4688c7e52cc54a353e290050 Mon Sep 17 00:00:00 2001
From: Bing Zhao <bingz at nvidia.com>
Date: Fri, 30 Jun 2023 12:13:14 +0300
Subject: [PATCH] net/mlx5: fix error set in Tx representor tagging
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 39ea353caf9bd0e671a2ad600a70608cf11c1898 ]

In the previous implementation, the error information was not set
when there was a failure during the initialization.

The pointer from the user should be passed to the called functions
to be set properly before returning.

Fixes: 483181f7b6dd ("net/mlx5: support device control of representor matching")

Signed-off-by: Bing Zhao <bingz at nvidia.com>
Acked-by: Ori Kam <orika at nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_hw.c | 42 +++++++++++++++++++--------------
 1 file changed, 24 insertions(+), 18 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index ea0159406f..60afc268bc 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -5295,12 +5295,14 @@ flow_hw_free_vport_actions(struct mlx5_priv *priv)
  *
  * @param dev
  *   Pointer to Ethernet device.
+ * @param[out] error
+ *   Pointer to error structure.
  *
  * @return
  *   Pointer to pattern template on success. NULL otherwise, and rte_errno is set.
  */
 static struct rte_flow_pattern_template *
-flow_hw_create_tx_repr_sq_pattern_tmpl(struct rte_eth_dev *dev)
+flow_hw_create_tx_repr_sq_pattern_tmpl(struct rte_eth_dev *dev, struct rte_flow_error *error)
 {
 	struct rte_flow_pattern_template_attr attr = {
 		.relaxed_matching = 0,
@@ -5319,7 +5321,7 @@ flow_hw_create_tx_repr_sq_pattern_tmpl(struct rte_eth_dev *dev)
 		},
 	};
 
-	return flow_hw_pattern_template_create(dev, &attr, items, NULL);
+	return flow_hw_pattern_template_create(dev, &attr, items, error);
 }
 
 static __rte_always_inline uint32_t
@@ -5377,12 +5379,15 @@ flow_hw_update_action_mask(struct rte_flow_action *action,
  *
  * @param dev
  *   Pointer to Ethernet device.
+ * @param[out] error
+ *   Pointer to error structure.
  *
  * @return
  *   Pointer to actions template on success. NULL otherwise, and rte_errno is set.
  */
 static struct rte_flow_actions_template *
-flow_hw_create_tx_repr_tag_jump_acts_tmpl(struct rte_eth_dev *dev)
+flow_hw_create_tx_repr_tag_jump_acts_tmpl(struct rte_eth_dev *dev,
+					  struct rte_flow_error *error)
 {
 	uint32_t tag_mask = flow_hw_tx_tag_regc_mask(dev);
 	uint32_t tag_value = flow_hw_tx_tag_regc_value(dev);
@@ -5468,7 +5473,7 @@ flow_hw_create_tx_repr_tag_jump_acts_tmpl(struct rte_eth_dev *dev)
 				   NULL, NULL);
 	idx++;
 	MLX5_ASSERT(idx <= RTE_DIM(actions_v));
-	return flow_hw_actions_template_create(dev, &attr, actions_v, actions_m, NULL);
+	return flow_hw_actions_template_create(dev, &attr, actions_v, actions_m, error);
 }
 
 static void
@@ -5497,12 +5502,14 @@ flow_hw_cleanup_tx_repr_tagging(struct rte_eth_dev *dev)
  *
  * @param dev
  *   Pointer to Ethernet device.
+ * @param[out] error
+ *   Pointer to error structure.
  *
  * @return
  *   0 on success, negative errno value otherwise.
  */
 static int
-flow_hw_setup_tx_repr_tagging(struct rte_eth_dev *dev)
+flow_hw_setup_tx_repr_tagging(struct rte_eth_dev *dev, struct rte_flow_error *error)
 {
 	struct mlx5_priv *priv = dev->data->dev_private;
 	struct rte_flow_template_table_attr attr = {
@@ -5520,20 +5527,22 @@ flow_hw_setup_tx_repr_tagging(struct rte_eth_dev *dev)
 
 	MLX5_ASSERT(priv->sh->config.dv_esw_en);
 	MLX5_ASSERT(priv->sh->config.repr_matching);
-	priv->hw_tx_repr_tagging_pt = flow_hw_create_tx_repr_sq_pattern_tmpl(dev);
+	priv->hw_tx_repr_tagging_pt =
+		flow_hw_create_tx_repr_sq_pattern_tmpl(dev, error);
 	if (!priv->hw_tx_repr_tagging_pt)
-		goto error;
-	priv->hw_tx_repr_tagging_at = flow_hw_create_tx_repr_tag_jump_acts_tmpl(dev);
+		goto err;
+	priv->hw_tx_repr_tagging_at =
+		flow_hw_create_tx_repr_tag_jump_acts_tmpl(dev, error);
 	if (!priv->hw_tx_repr_tagging_at)
-		goto error;
+		goto err;
 	priv->hw_tx_repr_tagging_tbl = flow_hw_table_create(dev, &cfg,
 							    &priv->hw_tx_repr_tagging_pt, 1,
 							    &priv->hw_tx_repr_tagging_at, 1,
-							    NULL);
+							    error);
 	if (!priv->hw_tx_repr_tagging_tbl)
-		goto error;
+		goto err;
 	return 0;
-error:
+err:
 	flow_hw_cleanup_tx_repr_tagging(dev);
 	return -rte_errno;
 }
@@ -6860,8 +6869,7 @@ flow_hw_configure(struct rte_eth_dev *dev,
 		goto err;
 	}
 
-	memcpy(_queue_attr, queue_attr,
-	       sizeof(void *) * nb_queue);
+	memcpy(_queue_attr, queue_attr, sizeof(void *) * nb_queue);
 	_queue_attr[nb_queue] = &ctrl_queue_attr;
 	priv->acts_ipool = mlx5_ipool_create(&cfg);
 	if (!priv->acts_ipool)
@@ -6976,11 +6984,9 @@ flow_hw_configure(struct rte_eth_dev *dev,
 			goto err;
 	}
 	if (priv->sh->config.dv_esw_en && priv->sh->config.repr_matching) {
-		ret = flow_hw_setup_tx_repr_tagging(dev);
-		if (ret) {
-			rte_errno = -ret;
+		ret = flow_hw_setup_tx_repr_tagging(dev, error);
+		if (ret)
 			goto err;
-		}
 	}
 	if (is_proxy) {
 		ret = flow_hw_create_vport_actions(priv);
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-08-09 21:51:20.052060700 +0800
+++ 0074-net-mlx5-fix-error-set-in-Tx-representor-tagging.patch	2023-08-09 21:51:18.224352000 +0800
@@ -1 +1 @@
-From 39ea353caf9bd0e671a2ad600a70608cf11c1898 Mon Sep 17 00:00:00 2001
+From 0a632c40ee7dcbfc4688c7e52cc54a353e290050 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 39ea353caf9bd0e671a2ad600a70608cf11c1898 ]
@@ -13 +15,0 @@
-Cc: stable at dpdk.org
@@ -18,2 +20,2 @@
- drivers/net/mlx5/mlx5_flow_hw.c | 44 +++++++++++++++++++--------------
- 1 file changed, 25 insertions(+), 19 deletions(-)
+ drivers/net/mlx5/mlx5_flow_hw.c | 42 +++++++++++++++++++--------------
+ 1 file changed, 24 insertions(+), 18 deletions(-)
@@ -22 +24 @@
-index a0c7956626..697da91f03 100644
+index ea0159406f..60afc268bc 100644
@@ -25 +27 @@
-@@ -5965,12 +5965,14 @@ flow_hw_destroy_send_to_kernel_action(struct mlx5_priv *priv)
+@@ -5295,12 +5295,14 @@ flow_hw_free_vport_actions(struct mlx5_priv *priv)
@@ -41 +43 @@
-@@ -5989,7 +5991,7 @@ flow_hw_create_tx_repr_sq_pattern_tmpl(struct rte_eth_dev *dev)
+@@ -5319,7 +5321,7 @@ flow_hw_create_tx_repr_sq_pattern_tmpl(struct rte_eth_dev *dev)
@@ -50 +52 @@
-@@ -6047,12 +6049,15 @@ flow_hw_update_action_mask(struct rte_flow_action *action,
+@@ -5377,12 +5379,15 @@ flow_hw_update_action_mask(struct rte_flow_action *action,
@@ -67 +69 @@
-@@ -6141,7 +6146,7 @@ flow_hw_create_tx_repr_tag_jump_acts_tmpl(struct rte_eth_dev *dev)
+@@ -5468,7 +5473,7 @@ flow_hw_create_tx_repr_tag_jump_acts_tmpl(struct rte_eth_dev *dev)
@@ -76 +78 @@
-@@ -6170,12 +6175,14 @@ flow_hw_cleanup_tx_repr_tagging(struct rte_eth_dev *dev)
+@@ -5497,12 +5502,14 @@ flow_hw_cleanup_tx_repr_tagging(struct rte_eth_dev *dev)
@@ -92 +94 @@
-@@ -6193,20 +6200,22 @@ flow_hw_setup_tx_repr_tagging(struct rte_eth_dev *dev)
+@@ -5520,20 +5527,22 @@ flow_hw_setup_tx_repr_tagging(struct rte_eth_dev *dev)
@@ -122 +124 @@
-@@ -7638,8 +7647,7 @@ flow_hw_configure(struct rte_eth_dev *dev,
+@@ -6860,8 +6869,7 @@ flow_hw_configure(struct rte_eth_dev *dev,
@@ -132,10 +134 @@
-@@ -7732,7 +7740,7 @@ flow_hw_configure(struct rte_eth_dev *dev,
- 		MLX5_ASSERT(rte_eth_dev_is_valid_port(port_attr->host_port_id));
- 		if (is_proxy) {
- 			DRV_LOG(ERR, "cross vHCA shared mode not supported "
--				     " for E-Switch confgiurations");
-+				"for E-Switch confgiurations");
- 			rte_errno = ENOTSUP;
- 			goto err;
- 		}
-@@ -7816,11 +7824,9 @@ flow_hw_configure(struct rte_eth_dev *dev,
+@@ -6976,11 +6984,9 @@ flow_hw_configure(struct rte_eth_dev *dev,


More information about the stable mailing list