From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795639853; b=49b+M4YOht+H7+KsMSZ7zaoh4RO0q8iVgYZSIlDZpUEt4Wf6Cvuj7+OhU43PbX4yzwKe xGPZpkHNDlf0+XC3+Q9YWkJQf6xDeB0ztZTI2CbEUr7Olp7lTuJTFYCj9Php/qzrTrSeR gpylfA/FuwGdxLT0rSc2qw9FidqvNCsRW3d9glVAqlTUWP0Xp6GOkk60eRMThTxUzFtUn GoPsHSStwpdSI5nveoL5LlIgrMXPbREmVR0CpueC47K1bvIbm24LY4Vtx16IBsf3cVPR9 fp6kKPHzTNzsIXj5hbn5n1MKvS3Mc00CeAWAHtODCB8Y2cHuCasSBLGKyUFx1V/eUdg== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795639853; h=Received:DKIM-Signature:Received:From:Date:Subject:MIME-Version: Content-Type:Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=GlmkAcGc9AnZ4frKpmXLn7fY55yufhFGgXFPly53mF8=; b=VDXxGHnHGXGQxinNR3iCYDblqwF+we80aqHwAefkEFWiOg6AfWQ5r4JB94HoSxrrNDDc 0MgJnCNBpT/WYw9Qq9wdxlEt/RtCH1mYFH5/zvUdrFeYc1xqDRGTmPgtyzeOiW1vsYhyc aj6FYGHQwNewHvqVP4r0Sx0Zx3XeUbFHiZfS9O0Pw/vsJExsMsolNCM4r8Ap+RMlCa2HV 5mNEYiBbzmgm//27Y2tcKN2j5CuNcfS/JaKOcehZpYpgOmT/TnhUjHgU1k8uaCFzD44L4 7kdRKpGJNhj4qd5Ula3rJJPbT7HXueETHKu6hgz5ggXf1KBR6r4S74dAEroXeR4LvcA== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=lCCE2Pg0; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 72E2C606A335; Wed, 25 Nov 2026 20:50:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=lCCE2Pg0 Authentication-Results: smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 ARC-Seal: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; cv=none; t=1795639853; b=e9k391MsYAWXGBZ5En9ir/PoBhpY+TNXc67sKAWvx+iRTYZynX5mnkOA7Z2QZyA3FFkE x62YzTKAE6GRsNOSomNoawYw+s+nU2RuHiDVsGXniBMR787tey505auVn5x3oDwgnxpVs JLHBGvKzrPmugFYUk3/EXoM6e0wdK8LfmDwzkdsrq0RSW+c5wOquXWbdrW73yi+abBPrf ecugQ0RqSCjFL/5kmBCTKA+Q6YFW7EjQZ+wlXGKoxGVgsB43ZuJzXhHOJIq0klJlzni8T hDQ3M621/WqPimT/g6RQt/Jz5zgD47rBoLD0xOteiOlMgtRbFqLftlBnP2QWTgpIOTg== ARC-Message-Signature: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; c=relaxed/relaxed; t=1795639853; h=DKIM-Signature:Received:From:Date:Subject:MIME-Version:Content-Type: Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=GlmkAcGc9AnZ4frKpmXLn7fY55yufhFGgXFPly53mF8=; b=e7Eko5gzA1xoLamrIbgMWr1pferPHzp946ql/5ZV1/PopOBOgI5YUcrdTQJR9Nt7cz5J jOOwNbKe3JOM8NZwL+1TFlL/FZlCV4WRXTusaNQTfilADCJ1p79WdeLG8VtHy1f+5CaGR NAuSw4u/Jgo/Kmf/pfXCafwlPWhcd3wkP7UPuy3yhXLUQ3bayX3y/UpsDp05NtDy+1tFF u341CmlBdOjHHFgud3+58ySkrflDQoQR7s512w0vmVT84LULLHeBtNUjqPhHOt1MQxNng nN+jUfuWF/xYYNyyUVH0Guq4BCuMIuIe+njh6774RPjMrg7OLwCUnFwqh1KzqP1pE2g== ARC-Authentication-Results: i=1; smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 Received: from lkml.kernel.org (nexus.subspace.kernel.org [100.80.115.77]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.kernel.org (Postfix) with ESMTPS id 5275A1F000CF; Wed, 25 Nov 2026 20:50:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795639852; bh=GlmkAcGc9AnZ4frKpmXLn7fY55yufhFGgXFPly53mF8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To; b=lCCE2Pg0EojyawFKtqz7v33Chh6n9Z0siIfqM2nL8nd9lkGt2EhNn+/IuZTiVjvtb pzsF8kRxMyd7WDChD0o/iAh393p4eHNtYyEJeOqYZ4RDg+I3peZ5oddv23SZU31WjZ UWKNApYS87m7l61rvpzDHkOwXATwhva0Vc4WZK3aJqpYl+iO1eKiiiFCiU3di28PvC yiVa2Y8sw9CF4bJ45Buz/fpA+5dhuBqv3XAke7+hzJzL040vAY5+vah8t0u6PeMehH dUct+s8e5M7ZfGEP5+REXB2QDrEmdfXAJJxLOaQH1kKkjsB7jda6APhg3r4OBIe41C fixIO//QTT0Cw== Received: from nexus.subspace.kernel.org (localhost [IPv6:::1]) by lkml.kernel.org (Postfix) with ESMTP id 2D0FE4D05B; Wed, 25 Nov 2026 20:50:32 +0000 (UTC) From: Fil Dunsky via B4 Relay Date: Wed, 25 Nov 2026 23:50:35 +0300 Subject: [PATCH RFC net-next 7/7] docs: networking: describe the CS7542 flowtable RFC limits X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Message-Id: <20261125-almondplus-offload-rfc-v1-7-703175c6340c@gmail.com> References: <20261125-almondplus-offload-rfc-v1-0-703175c6340c@gmail.com> In-Reply-To: <20261125-almondplus-offload-rfc-v1-0-703175c6340c@gmail.com> To: Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , Simon Horman , Pablo Neira Ayuso , Florian Westphal , Phil Sutter , Hans Ulli Kroll , Linus Walleij , Andrew Lunn , Russell King , Christian Marangi , Jonathan Corbet , Shuah Khan , Randy Dunlap 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 X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1795639829; l=7601; i=filipp.dunsky@gmail.com; s=20260930; h=from:subject:message-id; bh=/LLBgDu2W64JTNlAWpTpKMSB1T1Pf4WK5w8P8fK4qoU=; b=9pT84902ZU5MxLm8C/bMqb5Cm0U++CiHuoAF76UHN91JHgQgLR/IMTXkCWNXvt1L4mLae6csy DazXsyjCU5YDNQBsNdWPGV0pjCCA+Nqo8t5/3Yy9VrfP/TnRuIqBN1T X-Developer-Key: i=filipp.dunsky@gmail.com; a=ed25519; pk=JAYP8e2rJ54DHOmhNtXud8rl1igAaAXoOHxtJmVXI1g= X-Endpoint-Received: by B4 Relay for filipp.dunsky@gmail.com/20260930 with auth_id=1085 X-Original-From: Fil Dunsky Reply-To: filipp.dunsky@gmail.com Content-Transfer-Encoding: 7bit From: Fil Dunsky 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 --- .../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 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 -- 2.53.0