patch 'net/txgbe: fix FDIR error handling in flow creation' has been queued to stable release 25.11.5

Kevin Traynor ktraynor at redhat.com
Thu Dec 3 13:59:55 CET 2026


Hi,

FYI, your patch has been queued to stable release 25.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 12/08/26. 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/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/f49993580e09d5572129d65b11af2787b280c39a

Thanks.

Kevin

---
>From f49993580e09d5572129d65b11af2787b280c39a Mon Sep 17 00:00:00 2001
From: Tengfei Zhang <zhtfdev at gmail.com>
Date: Sat, 19 Sep 2026 02:30:11 +0800
Subject: [PATCH] net/txgbe: fix FDIR error handling in flow creation

[ upstream commit e896922ed2bcb94c7548477f675b29ed2ace1f25 ]

On failure, txgbe_flow_create() calls rte_flow_error_set(error, -ret),
so ret must be a negative errno. The FDIR flex offset mismatch path
leaves ret at 0, and the application sees errno 0. The global mask
memcmp path stores memcmp's return value in ret, which is not an
errno. Set -EINVAL on both paths.

Reject a mask-only FDIR rule before allocating the software object or
programming the global input mask, so a failed create cannot leave the
mask committed.

Fixes: 5c2352b9ece6 ("net/txgbe: support creating consistent filter")

Signed-off-by: Tengfei Zhang <zhtfdev at gmail.com>
---
 drivers/net/txgbe/txgbe_flow.c | 55 ++++++++++++++++++----------------
 1 file changed, 29 insertions(+), 26 deletions(-)

diff --git a/drivers/net/txgbe/txgbe_flow.c b/drivers/net/txgbe/txgbe_flow.c
index cb4d347e61..71d9f98b02 100644
--- a/drivers/net/txgbe/txgbe_flow.c
+++ b/drivers/net/txgbe/txgbe_flow.c
@@ -3348,4 +3348,9 @@ next:
 		}
 
+		if (!fdir_rule.b_spec) {
+			ret = -EINVAL;
+			goto out;
+		}
+
 		fdir_rule_ptr = rte_zmalloc("txgbe_fdir_filter",
 				sizeof(struct txgbe_fdir_rule_ele), 0);
@@ -3389,10 +3394,10 @@ next:
 				 * all the masks should be the same.
 				 */
-				ret = memcmp(&fdir_info->mask,
+				if (memcmp(&fdir_info->mask,
 					&fdir_rule.mask,
-					sizeof(struct txgbe_hw_fdir_mask));
-				if (ret) {
+					sizeof(struct txgbe_hw_fdir_mask)) != 0) {
 					PMD_DRV_LOG(ERR, "only support one global mask");
 					rte_free(fdir_rule_ptr);
+					ret = -EINVAL;
 					goto out;
 				}
@@ -3402,5 +3407,8 @@ next:
 				    fdir_info->flex_relative !=
 				    fdir_rule.flex_relative) {
+					PMD_DRV_LOG(ERR,
+						"flex bytes offset mismatch");
 					rte_free(fdir_rule_ptr);
+					ret = -EINVAL;
 					goto out;
 				}
@@ -3408,29 +3416,24 @@ next:
 		}
 
-		if (fdir_rule.b_spec) {
-			ret = txgbe_fdir_filter_program(dev, &fdir_rule,
-					FALSE, FALSE);
-			if (ret) {
-				rte_free(fdir_rule_ptr);
-				/**
-				 * clean the mask_added flag if fail to
-				 * program
-				 **/
-				if (first_mask)
-					fdir_info->mask_added = FALSE;
-				goto out;
-			}
-
-			fdir_rule_ptr->filter_info = fdir_rule;
-			TAILQ_INSERT_TAIL(&filter_fdir_list,
-				fdir_rule_ptr, entries);
-			flow->rule = fdir_rule_ptr;
-			flow->filter_type = RTE_ETH_FILTER_FDIR;
-
-			return flow;
+		ret = txgbe_fdir_filter_program(dev, &fdir_rule,
+				FALSE, FALSE);
+		if (ret) {
+			rte_free(fdir_rule_ptr);
+			/**
+			 * clean the mask_added flag if fail to
+			 * program
+			 **/
+			if (first_mask)
+				fdir_info->mask_added = FALSE;
+			goto out;
 		}
 
-		rte_free(fdir_rule_ptr);
-		goto out;
+		fdir_rule_ptr->filter_info = fdir_rule;
+		TAILQ_INSERT_TAIL(&filter_fdir_list,
+			fdir_rule_ptr, entries);
+		flow->rule = fdir_rule_ptr;
+		flow->filter_type = RTE_ETH_FILTER_FDIR;
+
+		return flow;
 	}
 
-- 
2.56.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-12-03 12:52:41.265758090 +0000
+++ 0069-net-txgbe-fix-FDIR-error-handling-in-flow-creation.patch	2026-12-03 12:52:39.067662183 +0000
@@ -1 +1 @@
-From e896922ed2bcb94c7548477f675b29ed2ace1f25 Mon Sep 17 00:00:00 2001
+From f49993580e09d5572129d65b11af2787b280c39a Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit e896922ed2bcb94c7548477f675b29ed2ace1f25 ]
+
@@ -17 +18,0 @@
-Cc: stable at dpdk.org
@@ -25 +26 @@
-index a1a497fa22..f8d8c6850d 100644
+index cb4d347e61..71d9f98b02 100644



More information about the stable mailing list