From: Abdulrahman Alshawi <ashawi@wirefilter.com>
To: dev <dev@dpdk.org>
Cc: bharat <bharat@chelsio.com>, stable <stable@dpdk.org>
Subject: [PATCH 2/2] net/cxgbe: restrict rte flow rules to ingress port
Date: Mon, 27 Apr 2026 19:42:52 +0300 (AST) [thread overview]
Message-ID: <48263833.15868423.1777308172969.JavaMail.zimbra@wirefilter.com> (raw)
In-Reply-To: <2136264989.15868282.1777307418083.JavaMail.zimbra@wirefilter.com>
[-- Attachment #1: Type: text/plain, Size: 5361 bytes --]
Chelsio filters are programmed in adapter-wide LE/TCAM tables shared by all ports. rte_flow rules, however, are created on a specific ethdev and are expected to apply to traffic arriving on that port. The PMD already supports ingress-port matching in the hardware filter spec. The iport field is validated, used for hash-region selection when tp.port_shift is available, and emitted in the firmware filter work request. But the rte_flow parser never sets fs.val.iport/fs.mask.iport for normal per-port rules. As a result, a rule created on one port is installed as an adapter-wide match and can steer traffic received on sibling ports of the same adapter. In practice this causes cross-port steering. For example, a rule like vlan 100 -> queue 3 created on port 0 can also match VLAN 100 traffic arriving on port 1 and redirect it into port 0's queue 3. Fix this by stamping the creating ethdev's physical ingress port into the filter spec before filter placement is decided. Only do this when the active filter mode includes the port field (tp.port_shift >= 0). If port matching is not available in the current filter mode, keep the existing adapter-wide behavior. Reproduce (two ports of the same adapter bound to DPDK): dpdk-testpmd -l 1-9 -a 0000:18:00.4 -a 0000:18:00.5 \ -- --rxq=4 --txq=4 --forward-mode=rxonly -i testpmd> flow create 0 ingress pattern eth \ / vlan tci is 100 / end actions queue index 3 / end testpmd> start Without this patch, VLAN 100 traffic received on port 1 can be steered by the rule created on port 0. With the patch, the rule only matches traffic arriving on port 0. Signed-off-by: Abdulrahman Alshawi <ashawi@wirefilter.com> --- .mailmap | 1 + drivers/net/cxgbe/cxgbe_flow.c | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/.mailmap b/.mailmap index 0e0d83e1c6..a6bcbd5756 100644 --- a/.mailmap +++ b/.mailmap @@ -4,6 +4,7 @@ Aaro Koskinen <aaro.koskinen@nsn.com> Aaron Campbell <aaron@arbor.net> Aaron Conole <aconole@redhat.com> Abdullah Ömer Yamaç <omer.yamac@ceng.metu.edu.tr> <aomeryamac@gmail.com> +Abdulrahman Alshawi <ashawi@wirefilter.com> Abdullah Sevincer <abdullah.sevincer@intel.com> Abed Kamaluddin <akamaluddin@marvell.com> Abhijit Gangurde <abhijit.gangurde@amd.com> diff --git a/drivers/net/cxgbe/cxgbe_flow.c b/drivers/net/cxgbe/cxgbe_flow.c index 14b9b49792..dd0634131e 100644 --- a/drivers/net/cxgbe/cxgbe_flow.c +++ b/drivers/net/cxgbe/cxgbe_flow.c @@ -172,6 +172,24 @@ cxgbe_fill_filter_region(struct adapter *adap, fs->cap = 1; /* use hash region */ } +static void +cxgbe_scope_flow_to_port(struct rte_flow *flow) +{ + struct adapter *adap = ethdev2adap(flow->dev); + struct port_info *pi = ethdev2pinfo(flow->dev); + + /* + * Chelsio filters are programmed in adapter-global tables. DPDK + * ingress rte_flow rules are created on a specific ethdev, so include + * the physical ingress port when the active filter mode supports it. + */ + if (adap->params.tp.port_shift < 0) + return; + + flow->fs.val.iport = pi->port_id; + flow->fs.mask.iport = (1U << IPORT_BITWIDTH) - 1; +} + static int ch_rte_parsetype_eth(const void *dmask, const struct rte_flow_item *item, struct ch_filter_specification *fs, @@ -986,6 +1004,7 @@ cxgbe_rtef_parse_items(struct rte_flow *flow, } cxgbe_tweak_filter_spec(adap, &flow->fs); + cxgbe_scope_flow_to_port(flow); cxgbe_fill_filter_region(adap, &flow->fs); return 0; -- 2.39.5
-----Original Message-----
From: Abdulrahman <ashawi@wirefilter.com>
To: dev <dev@dpdk.org>
Cc: bharat <bharat@chelsio.com>; stable <stable@dpdk.org>
Date: Monday, 27 April 2026 7:30 PM +03
Subject: [PATCH 0/2] net/cxgbe: fix packed Rx handling and flow port scoping
This series fixes two correctness issues in the cxgbe PMD that can cause
traffic loss on Chelsio T6 adapters, especially when rte_flow QUEUE
rules concentrate ingress on a small set of RX queues.
Patch 1 fixes packed Rx response handling. The current PMD assumes every
response descriptor starts a new Free List buffer by requiring
F_RSPD_NEWBUF on each response. That assumption does not always hold for
packed ingress responses. Under sustained small-packet traffic to a
single ingress queue, the FL/IQ state goes out of sync and the affected
Rx path stops making forward progress.
Patch 2 scopes rte_flow rules to the ingress port they were created on.
Chelsio filters are programmed in adapter-wide tables, and the PMD
already supports the iport field in the hardware filter spec. However,
the flow parser never fills it for normal per-port rules, so a rule
created on one port can also match traffic arriving on sibling ports of
the same adapter.
Both issues reproduce with stock testpmd on T62100-LP-CR. The per-patch
commit messages include the details and reproducers.
Abdulrahman Alshawi (2):
net/cxgbe: fix Rx handling for packed responses
net/cxgbe: restrict rte_flow rules to ingress port
.mailmap | 1 +
drivers/net/cxgbe/base/adapter.h | 1 +
drivers/net/cxgbe/cxgbe_flow.c | 19 +++++
drivers/net/cxgbe/sge.c | 122 ++++++++++++++++++++++++-------
4 files changed, 118 insertions(+), 25 deletions(-)
--
2.39.5
[-- Attachment #2: Type: text/html, Size: 25950 bytes --]
next prev parent reply other threads:[~2026-04-29 9:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-27 16:30 [PATCH 0/2] net/cxgbe: fix packed Rx handling and flow port scoping Abdulrahman Alshawi
2026-04-27 16:40 ` [PATCH 1/2] net/cxgbe: fix Rx handling for packed responses Abdulrahman Alshawi
2026-04-28 7:05 ` Abdulrahman Alshawi
2026-04-27 16:42 ` Abdulrahman Alshawi [this message]
2026-04-28 7:03 ` [PATCH 2/2] net/cxgbe: restrict rte flow rules to ingress port Abdulrahman Alshawi
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=48263833.15868423.1777308172969.JavaMail.zimbra@wirefilter.com \
--to=ashawi@wirefilter.com \
--cc=bharat@chelsio.com \
--cc=dev@dpdk.org \
--cc=stable@dpdk.org \
/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