DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Zhang Tengfei <zhtfdev@gmail.com>
To: Jiawen Wu <jiawenwu@trustnetic.com>,
	Zaiyu Wang <zaiyuwang@trustnetic.com>
Cc: dev@dpdk.org, stephen@networkplumber.org,
	Zhang Tengfei <zhtfdev@gmail.com>,
	stable@dpdk.org
Subject: [PATCH v2 3/3] net/txgbe: fix flow create error codes
Date: Wed, 16 Sep 2026 21:11:05 +0800	[thread overview]
Message-ID: <20260916131106.105667-4-zhtfdev@gmail.com> (raw)
In-Reply-To: <20260916131106.105667-1-zhtfdev@gmail.com>

txgbe_flow_create() reports failures with rte_flow_error_set(error, -ret).
The FDIR flex offset mismatch and mask-only paths jump to that handler
with ret == 0, so the application sees a failed create and errno 0. The
global mask memcmp path stores memcmp's positive result in ret, so -ret
is negative.

Set -EINVAL on these paths.

Fixes: 5c2352b9ece6 ("net/txgbe: support creating consistent filter")
Cc: stable@dpdk.org

Signed-off-by: Zhang Tengfei <zhtfdev@gmail.com>
---
 drivers/net/txgbe/txgbe_flow.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/txgbe/txgbe_flow.c b/drivers/net/txgbe/txgbe_flow.c
index a1a497fa22..084b1eec1d 100644
--- a/drivers/net/txgbe/txgbe_flow.c
+++ b/drivers/net/txgbe/txgbe_flow.c
@@ -3388,12 +3388,12 @@ txgbe_flow_create(struct rte_eth_dev *dev,
 				 * 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;
 				}
 
@@ -3402,6 +3402,7 @@ txgbe_flow_create(struct rte_eth_dev *dev,
 				    fdir_info->flex_relative !=
 				    fdir_rule.flex_relative) {
 					rte_free(fdir_rule_ptr);
+					ret = -EINVAL;
 					goto out;
 				}
 			}
@@ -3431,6 +3432,7 @@ txgbe_flow_create(struct rte_eth_dev *dev,
 		}
 
 		rte_free(fdir_rule_ptr);
+		ret = -EINVAL;
 		goto out;
 	}
 
-- 
2.53.0


  parent reply	other threads:[~2026-09-16 13:12 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-15 15:24 [PATCH] net/txgbe: fix leak of filters on flow create Zhang Tengfei
2026-09-15 15:38 ` Stephen Hemminger
2026-09-15 15:48   ` Zhang Tengfei
2026-09-16 13:11 ` [PATCH v2 0/3] net/txgbe: fix flow create errors Zhang Tengfei
2026-09-16 13:11   ` [PATCH v2 1/3] net/txgbe: fix L2 tunnel error on flow create Zhang Tengfei
2026-09-16 13:11   ` [PATCH v2 2/3] net/txgbe: fix leak of filters " Zhang Tengfei
2026-09-16 13:11   ` Zhang Tengfei [this message]
2026-09-16 16:21   ` [PATCH v2 0/3] net/txgbe: fix flow create errors Stephen Hemminger
2026-09-17 15:32   ` [PATCH v3 " Zhang Tengfei
2026-09-17 15:32     ` [PATCH v3 1/3] net/txgbe: fix L2 tunnel error on flow create Zhang Tengfei
2026-09-17 15:32     ` [PATCH v3 2/3] net/txgbe: fix leak of filters " Zhang Tengfei
2026-09-17 15:32     ` [PATCH v3 3/3] net/txgbe: fix FDIR error handling " Zhang Tengfei
2026-09-18 16:06     ` [PATCH v3 0/3] net/txgbe: fix flow create errors Stephen Hemminger
2026-09-18 18:14       ` Zhang Tengfei
2026-09-18 18:30     ` [PATCH v4 " Zhang Tengfei
2026-09-18 18:30       ` [PATCH v4 1/3] net/txgbe: fix L2 tunnel error on flow create Zhang Tengfei
2026-09-18 18:30       ` [PATCH v4 2/3] net/txgbe: fix leak of filters " Zhang Tengfei
2026-09-18 18:30       ` [PATCH v4 3/3] net/txgbe: fix FDIR error handling " Zhang Tengfei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260916131106.105667-4-zhtfdev@gmail.com \
    --to=zhtfdev@gmail.com \
    --cc=dev@dpdk.org \
    --cc=jiawenwu@trustnetic.com \
    --cc=stable@dpdk.org \
    --cc=stephen@networkplumber.org \
    --cc=zaiyuwang@trustnetic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox