patch 'net/txgbe: fix FDIR error handling in flow creation' has been queued to stable release 24.11.9
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Tue Oct 27 12:49:05 CET 2026
Hi,
FYI, your patch has been queued to stable release 24.11.9
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 10/29/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/bluca/dpdk-stable
This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/b6b578ea21b80d046cd4a6f0d9f288a31694e335
Thanks.
Luca Boccassi
---
>From b6b578ea21b80d046cd4a6f0d9f288a31694e335 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 d2912c4345e..6f321ebf497 100644
--- a/drivers/net/txgbe/txgbe_flow.c
+++ b/drivers/net/txgbe/txgbe_flow.c
@@ -3292,6 +3292,11 @@ next:
ret = txgbe_parse_fdir_filter(dev, attr, pattern,
actions, &fdir_rule, error);
if (!ret) {
+ if (!fdir_rule.b_spec) {
+ ret = -EINVAL;
+ goto out;
+ }
+
fdir_rule_ptr = rte_zmalloc("txgbe_fdir_filter",
sizeof(struct txgbe_fdir_rule_ele), 0);
if (!fdir_rule_ptr) {
@@ -3335,12 +3340,12 @@ next:
* Only support one global mask,
* 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;
}
@@ -3348,37 +3353,35 @@ next:
fdir_rule.flex_bytes_offset ||
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;
}
}
}
- 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;
}
memset(&l2_tn_filter, 0, sizeof(struct txgbe_l2_tunnel_conf));
--
2.47.3
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-10-27 11:43:55.709440111 +0000
+++ 0051-net-txgbe-fix-FDIR-error-handling-in-flow-creation.patch 2026-10-27 11:43:53.558060811 +0000
@@ -1 +1 @@
-From e896922ed2bcb94c7548477f675b29ed2ace1f25 Mon Sep 17 00:00:00 2001
+From b6b578ea21b80d046cd4a6f0d9f288a31694e335 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 d2912c4345e..6f321ebf497 100644
@@ -28,4 +29,4 @@
-@@ -3347,6 +3347,11 @@ next:
- return flow;
- }
-
+@@ -3292,6 +3292,11 @@ next:
+ ret = txgbe_parse_fdir_filter(dev, attr, pattern,
+ actions, &fdir_rule, error);
+ if (!ret) {
@@ -40 +41 @@
-@@ -3388,12 +3393,12 @@ next:
+@@ -3335,12 +3340,12 @@ next:
@@ -56 +57 @@
-@@ -3401,37 +3406,35 @@ next:
+@@ -3348,37 +3353,35 @@ next:
More information about the stable
mailing list