From: Stephen Hemminger <stephen@networkplumber.org>
To: Zhang Tengfei <zhtfdev@gmail.com>
Cc: dev@dpdk.org
Subject: Re: [PATCH v2 0/3] net/txgbe: fix flow create errors
Date: Wed, 16 Sep 2026 09:21:48 -0700 [thread overview]
Message-ID: <20260916092148.764a8361@phoenix.local> (raw)
In-Reply-To: <20260916131106.105667-1-zhtfdev@gmail.com>
On Wed, 16 Sep 2026 21:11:02 +0800
Zhang Tengfei <zhtfdev@gmail.com> wrote:
> v2:
> - split L2 tunnel add-failure goto out into its own patch
> - allocate FDIR object before installing the global mask
> - add Fixes tag for the VF FDIR path
> - set -EINVAL on remaining FDIR goto out paths with bad ret
> - use struct assignment instead of rte_memcpy for filter copies
>
> 1/3 fix L2 tunnel error on flow create
> 2/3 fix leak of filters on flow create
> 3/3 fix flow create error codes
>
> Zhang Tengfei (3):
> net/txgbe: fix L2 tunnel error on flow create
> net/txgbe: fix leak of filters on flow create
> net/txgbe: fix flow create error codes
>
> drivers/net/txgbe/txgbe_flow.c | 240 +++++++++++++++++----------------
> 1 file changed, 126 insertions(+), 114 deletions(-)
>
Looks good still some small items found by AI review:
Review: [PATCH v2 0/3] net/txgbe: flow create fixes
Author: Zhang Tengfei <zhtfdev@gmail.com>
Series applies cleanly to main; each commit builds with -Dwerror=true.
Fixes: tags resolve (5c2352b9ece6 in 21.02, 7eef71080e16 in 25.11),
so Cc: stable is correct.
Patch 2/3 checked for early copies: ntuple, ethertype, SYN and L2
tunnel add helpers do not modify their input, so copying filter_info
before programming is safe. FDIR (PF and VF) copies after programming.
Element types match the old rte_memcpy sizes, struct assignment is
equivalent.
Patch 3/3: net/txgbe: fix flow create error codes
Warning: mask-only FDIR rule fails but leaves global mask committed
With b_mask set and b_spec clear on the first FDIR rule,
txgbe_flow_create() programs the input mask via
txgbe_fdir_set_input_mask(), sets fdir_info->mask_added = TRUE,
then falls to the final path which now returns -EINVAL.
The application gets a failed create, holds no handle, yet the
global mask stays in hardware and mask_added stays set. Any later
rule with a different mask is rejected with "only support one
global mask" even though no FDIR flow exists. The b_spec failure
path already clears mask_added when first_mask is set; this path
does not.
The parser reaches this state: txgbe_parse_fdir_filter_normal() sets
b_mask on item->mask and b_spec only on item->spec.
Since this patch now declares the path an error, reject it before
touching hardware, e.g. right after the rte_zmalloc():
if (!fdir_rule.b_spec) {
rte_free(fdir_rule_ptr);
ret = -EINVAL;
goto out;
}
and drop the trailing free/-EINVAL block.
Info: commit message says memcmp stores a "positive result". memcmp()
returns any nonzero value of either sign, so -ret could be a random
positive or negative number. Reword to say the value is not an
errno.
Info: flex offset mismatch path returns -EINVAL with no log, unlike
the mask mismatch path right above it. Add a PMD_DRV_LOG(ERR, ...)
so the two rejections are distinguishable.
next prev parent reply other threads:[~2026-09-16 16:21 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 ` [PATCH v2 3/3] net/txgbe: fix flow create error codes Zhang Tengfei
2026-09-16 16:21 ` Stephen Hemminger [this message]
2026-09-17 15:32 ` [PATCH v3 0/3] net/txgbe: fix flow create errors 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=20260916092148.764a8361@phoenix.local \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=zhtfdev@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.