patch 'net/mlx5: fix flow template indirect action failure' has been queued to stable release 23.11.2

Xueming Li xuemingl at nvidia.com
Fri Jul 12 13:01:42 CEST 2024


Hi,

FYI, your patch has been queued to stable release 23.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/14/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=2a32678f150f9beed91f6563d4003f5c158be5dc

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 2a32678f150f9beed91f6563d4003f5c158be5dc Mon Sep 17 00:00:00 2001
From: Maayan Kashani <mkashani at nvidia.com>
Date: Sun, 26 May 2024 16:22:44 +0300
Subject: [PATCH] net/mlx5: fix flow template indirect action failure
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit b79ac509105a2cf9fce1734a6798632a0414cd1c ]

For indirect action type, on  error case the function jumped to err
but returned zero cause rte_errno was not initialized before the jump.
It caused no error in table creation.

In case reaching an error, if rte_errno is not initialized,
it will be set to EINVAL.
Now table creation should fail if the translate of the action fails.
Added driver log warnings so it can be easy to track failure on shared
actions translate.

Fixes: 7ab3962d2d2b ("net/mlx5: add indirect HW steering action")

Signed-off-by: Maayan Kashani <mkashani at nvidia.com>
Acked-by: Suanming Mou <suanmingm at nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_hw.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index 2f4b2d774e..39e68b39f7 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -1009,15 +1009,19 @@ flow_hw_shared_action_translate(struct rte_eth_dev *dev,
 		if (!shared_rss || __flow_hw_act_data_shared_rss_append
 		    (priv, acts,
 		    (enum rte_flow_action_type)MLX5_RTE_FLOW_ACTION_TYPE_RSS,
-		    action_src, action_dst, idx, shared_rss))
+		    action_src, action_dst, idx, shared_rss)) {
+			DRV_LOG(WARNING, "Indirect RSS action index %d translate failed", act_idx);
 			return -1;
+		}
 		break;
 	case MLX5_INDIRECT_ACTION_TYPE_COUNT:
 		if (__flow_hw_act_data_shared_cnt_append(priv, acts,
 			(enum rte_flow_action_type)
 			MLX5_RTE_FLOW_ACTION_TYPE_COUNT,
-			action_src, action_dst, act_idx))
+			action_src, action_dst, act_idx)) {
+			DRV_LOG(WARNING, "Indirect count action translate failed");
 			return -1;
+		}
 		break;
 	case MLX5_INDIRECT_ACTION_TYPE_AGE:
 		/* Not supported, prevent by validate function. */
@@ -1025,15 +1029,19 @@ flow_hw_shared_action_translate(struct rte_eth_dev *dev,
 		break;
 	case MLX5_INDIRECT_ACTION_TYPE_CT:
 		if (flow_hw_ct_compile(dev, MLX5_HW_INV_QUEUE,
-				       idx, &acts->rule_acts[action_dst]))
+				       idx, &acts->rule_acts[action_dst])) {
+			DRV_LOG(WARNING, "Indirect CT action translate failed");
 			return -1;
+		}
 		break;
 	case MLX5_INDIRECT_ACTION_TYPE_METER_MARK:
 		if (__flow_hw_act_data_shared_mtr_append(priv, acts,
 			(enum rte_flow_action_type)
 			MLX5_RTE_FLOW_ACTION_TYPE_METER_MARK,
-			action_src, action_dst, idx))
+			action_src, action_dst, idx)) {
+			DRV_LOG(WARNING, "Indirect meter mark action translate failed");
 			return -1;
+		}
 		break;
 	case MLX5_INDIRECT_ACTION_TYPE_QUOTA:
 		flow_hw_construct_quota(priv, &acts->rule_acts[action_dst], idx);
@@ -2516,6 +2524,9 @@ __flow_hw_actions_translate(struct rte_eth_dev *dev,
 	}
 	return 0;
 err:
+	/* If rte_errno was not initialized and reached error state. */
+	if (!rte_errno)
+		rte_errno = EINVAL;
 	err = rte_errno;
 	__flow_hw_action_template_destroy(dev, acts);
 	return rte_flow_error_set(error, err,
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-12 18:40:18.159726240 +0800
+++ 0091-net-mlx5-fix-flow-template-indirect-action-failure.patch	2024-07-12 18:40:14.296594204 +0800
@@ -1 +1 @@
-From b79ac509105a2cf9fce1734a6798632a0414cd1c Mon Sep 17 00:00:00 2001
+From 2a32678f150f9beed91f6563d4003f5c158be5dc Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit b79ac509105a2cf9fce1734a6798632a0414cd1c ]
@@ -17 +19,0 @@
-Cc: stable at dpdk.org
@@ -26 +28 @@
-index d9140dbf23..463f7b87a3 100644
+index 2f4b2d774e..39e68b39f7 100644
@@ -29 +31 @@
-@@ -1106,15 +1106,19 @@ flow_hw_shared_action_translate(struct rte_eth_dev *dev,
+@@ -1009,15 +1009,19 @@ flow_hw_shared_action_translate(struct rte_eth_dev *dev,
@@ -51 +53 @@
-@@ -1122,15 +1126,19 @@ flow_hw_shared_action_translate(struct rte_eth_dev *dev,
+@@ -1025,15 +1029,19 @@ flow_hw_shared_action_translate(struct rte_eth_dev *dev,
@@ -73 +75 @@
-@@ -2645,6 +2653,9 @@ __flow_hw_actions_translate(struct rte_eth_dev *dev,
+@@ -2516,6 +2524,9 @@ __flow_hw_actions_translate(struct rte_eth_dev *dev,


More information about the stable mailing list