From: Fil Dunsky via B4 Relay <devnull+filipp.dunsky.gmail.com@kernel.org>
To: Andrew Lunn <andrew@lunn.ch>, Vladimir Oltean <olteanv@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Florian Fainelli <f.fainelli@gmail.com>,
Simon Horman <horms@kernel.org>,
Pablo Neira Ayuso <pablo@netfilter.org>,
Florian Westphal <fw@strlen.de>, Phil Sutter <phil@nwl.cc>,
Hans Ulli Kroll <ulli.kroll@googlemail.com>,
Linus Walleij <linusw@kernel.org>,
Andrew Lunn <andrew+netdev@lunn.ch>,
Russell King <linux@armlinux.org.uk>,
Christian Marangi <ansuelsmth@gmail.com>,
Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>,
Randy Dunlap <rdunlap@infradead.org>
Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, netfilter-devel@vger.kernel.org,
coreteam@netfilter.org, linux-arm-kernel@lists.infradead.org,
linux-doc@vger.kernel.org, Fil Dunsky <filipp.dunsky@gmail.com>
Subject: [PATCH RFC net-next 7/7] docs: networking: describe the CS7542 flowtable RFC limits
Date: Wed, 25 Nov 2026 23:50:35 +0300 [thread overview]
Message-ID: <20261125-almondplus-offload-rfc-v1-7-703175c6340c@gmail.com> (raw)
In-Reply-To: <20261125-almondplus-offload-rfc-v1-0-703175c6340c@gmail.com>
From: Fil Dunsky <filipp.dunsky@gmail.com>
Record the real LAN/WAN NAT qualification and its precise limits:
immutable result capacity, conservative sticky-HIT aging, module
lifetime restrictions and software fallback. Distinguish precursor
hardware results from execution of the new Linux composition. Extend the
existing network-engine file patterns.
Signed-off-by: Fil Dunsky <filipp.dunsky@gmail.com>
---
.../ethernet/cortina/cs7542-flowtable.rst | 112 +++++++++++++++++++++
MAINTAINERS | 5 +
2 files changed, 117 insertions(+)
diff --git a/Documentation/networking/device_drivers/ethernet/cortina/cs7542-flowtable.rst b/Documentation/networking/device_drivers/ethernet/cortina/cs7542-flowtable.rst
new file mode 100644
index 000000000..bedb825b6
--- /dev/null
+++ b/Documentation/networking/device_drivers/ethernet/cortina/cs7542-flowtable.rst
@@ -0,0 +1,112 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+CS7542 hardware flowtable RFC
+============================
+
+This RFC connects the CS7542 forwarding engine to nftables hardware
+flowtables. The Ethernet driver remains the sole owner of packet DMA,
+indirect tables and network-engine reset. The forwarding algorithm and
+flowtable frontend are replaceable modules in this development version.
+They do not map hardware registers themselves.
+
+Supported path
+--------------
+
+The current path is wired IPv4 TCP/UDP NAT through a QCA8337 switch on the
+CS7542. It accepts physical user ports 1 through 5 on CPU port 0/GMAC1.
+Both ingress and egress must resolve to that conduit and to the initial
+network namespace. It checks the route, neighbor, bridge FDB, observed
+original Ethernet header, tag format and directional route MTU before
+publishing a lookup. Unsupported requests return to software processing.
+Wi-Fi and IPv6 are not accelerated.
+
+TCP admission additionally requires an established conntrack state. The
+flowtable supplies that state together with the route MTU. SYN, FIN,
+fragments, IP options, low TTL and packets outside the admitted length
+range remain on the CPU path. The driver does not infer a route MTU or an
+established connection from flower rewrite actions.
+
+The QCA four-byte CPU header puts an identifier ahead of the ordinary
+two-byte QCA metadata. This lets the CS7542 parser recognize the inner
+IPv4 header. CPU-port ``dsa-tag-protocol = "qca4"`` selects the format.
+Both configured CPU ports must agree. The default remains the ordinary
+two-byte QCA format. Ethernet management frames are not usable with this
+four-byte tagger, so switch register access stays on MDIO.
+
+Resource lifetime
+-----------------
+
+There are 16 admitted direction selectors and eight immutable result
+records in this implementation. A result includes every hardware-visible
+forwarding dependency. Identical results may be shared by independent
+selectors. A retired selector may be rebound only after invalidation and
+complete readback, with the original immutable result still present.
+Removing one selector does not retire another selector sharing its result.
+
+This is not general result reclamation. An incompatible result consumes
+another record. Eight different retained results exhaust this small
+allocation pool until a verified complete network-engine reset. Further
+flows fall back to software. A successful lookup withdrawal is not treated
+as proof that all in-flight hardware references have drained.
+
+Failed or ambiguous hardware transactions close admission and retain the
+state needed for isolation and recovery. The current replaceable modules
+remain pinned until the built-in manager completes checked detachment.
+Ordinary arbitrary module removal and suspend are not supported by this
+RFC. The Ethernet owner, switch and MDIO must be built in; forced module
+removal and power management are excluded by Kconfig. Consolidating this
+development interface into the Ethernet driver is an open design item.
+
+Activity accounting
+-------------------
+
+The hardware HIT bit is sticky. The driver only treats an observed
+zero-to-one transition as evidence of recent activity. It neither clears
+the bitmap without a proven drain protocol nor fabricates packet counters
+or fresh timestamps from repeated reads of the same set bit.
+
+Consequently an active connection can expire from the hardware flowtable
+at the normal Linux timeout and be learned again in software. On the
+tested OpenWrt configuration this produced one CPU packet in each direction
+at about 30-second intervals. This conservative refresh is a known limit,
+not evidence of uninterrupted hardware residency or accurate packet counts.
+
+Validation and provenance
+-------------------------
+
+The precursor on Almond+ OpenWrt 6.18.64 was tested with the standard LuCI
+hardware flow-offloading option and ordinary firewall4 NAT. LAN and WAN
+were separate physical switch ports. The client was 192.168.1.2; the WAN
+server was 10.42.0.1 and observed the translated router address 10.42.0.139.
+
+Byte-exact UDP exchanges covered IP lengths 512, 1400 and 1500 with DF
+set and clear. Both directions arrived with TTL 63. With flow offload
+disabled, the CPU capture contained all 72 marked packets. With hardware
+offload enabled it contained four of 212 packets: the two refresh pairs
+at 30 and 60 seconds. Capture reported no kernel drops. TCP exchanged
+2,293,760 verified bytes over 70 seconds; TCP and UDP conntrack entries
+retained HW_OFFLOAD at the 3, 35 and 69 second observations. TCP endpoints
+accepted the data; this is not an independent capture-based checksum
+audit of every accelerated TCP segment.
+
+A separate eight-connection test exercised 16 selectors sharing one result.
+Seven connections kept their original selectors and continued forwarding
+after the first connection was removed. These were correctness tests at a
+controlled rate, not throughput or maximum-capacity benchmarks.
+
+The Linux RFC changes the DSA selection interface, removes laboratory
+controls and adapts to current kernel APIs. Measurements of the precursor
+must not be represented as an execution of these exact Linux source bytes.
+Build and software-test results are recorded separately in the cover letter.
+
+Review questions
+----------------
+
+* Should directional route MTU and established TCP state be carried in the
+ flowtable's classifier request, or through a different common interface?
+* Is the standard DSA tag-selection property appropriate for this CPU
+ parser constraint and the two-conduit switch setup?
+* What hardware evidence would be sufficient to permit reclamation of
+ different result records and clearing the sticky HIT state safely?
+* Should the built-in owner and replaceable algorithm be consolidated
+ before a non-RFC submission?
diff --git a/MAINTAINERS b/MAINTAINERS
index d17acadaa..a70086354 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2966,7 +2966,12 @@ M: Fil Dunsky <filipp.dunsky@gmail.com>
L: netdev@vger.kernel.org
S: Maintained
F: Documentation/devicetree/bindings/net/cortina,cs7542-ethernet.yaml
+F: Documentation/networking/device_drivers/ethernet/cortina/cs7542-flowtable.rst
F: drivers/net/ethernet/cortina/cs752x_*
+F: drivers/net/ethernet/cortina/cs7542*
+F: drivers/net/ethernet/cortina/cs_fe_*
+F: drivers/net/ethernet/cortina/flowtable/
+F: include/linux/cs7542_*
ARM/CORTINA SYSTEMS GEMINI ARM ARCHITECTURE
M: Hans Ulli Kroll <ulli.kroll@googlemail.com>
--
2.53.0
next prev parent reply other threads:[~2026-11-25 20:50 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 20:50 [PATCH RFC net-next 0/7] net: cortina: CS7542 wired IPv4 hardware flowtable offload Fil Dunsky via B4 Relay
2026-11-25 20:50 ` [PATCH RFC net-next 1/7] dt-bindings: net: dsa: allow the QCA four-byte tag protocol Fil Dunsky via B4 Relay
2026-11-25 20:50 ` [PATCH RFC net-next 2/7] net: dsa: add a QCA four-byte CPU tagger Fil Dunsky via B4 Relay
2026-11-25 21:15 ` Andrew Lunn
2026-11-25 20:50 ` [PATCH RFC net-next 3/7] netfilter: flowtable: expose route MTU and established TCP context Fil Dunsky via B4 Relay
2026-11-25 20:50 ` [PATCH RFC net-next 4/7] net: cortina: add a serialized CS7542 forwarding engine owner Fil Dunsky via B4 Relay
2026-11-25 20:50 ` [PATCH RFC net-next 5/7] net: dsa: qca8k: select the four-byte format before port activation Fil Dunsky via B4 Relay
2026-11-25 21:13 ` Andrew Lunn
2026-11-25 20:50 ` [PATCH RFC net-next 6/7] net: cortina: connect wired IPv4 NAT to nftables hardware flowtables Fil Dunsky via B4 Relay
2026-11-25 20:50 ` Fil Dunsky via B4 Relay [this message]
2026-11-25 21:10 ` [PATCH RFC net-next 0/7] net: cortina: CS7542 wired IPv4 hardware flowtable offload Andrew Lunn
2026-11-25 21:55 ` Fil Dunsky
2026-11-25 22:10 ` Andrew Lunn
2026-11-25 22:56 ` Fil Dunsky
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=20261125-almondplus-offload-rfc-v1-7-703175c6340c@gmail.com \
--to=devnull+filipp.dunsky.gmail.com@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@lunn.ch \
--cc=ansuelsmth@gmail.com \
--cc=conor+dt@kernel.org \
--cc=corbet@lwn.net \
--cc=coreteam@netfilter.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@kernel.org \
--cc=f.fainelli@gmail.com \
--cc=filipp.dunsky@gmail.com \
--cc=fw@strlen.de \
--cc=horms@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linusw@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=pablo@netfilter.org \
--cc=phil@nwl.cc \
--cc=rdunlap@infradead.org \
--cc=robh@kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=ulli.kroll@googlemail.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
all inboxes | Powered by JetHome®