From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.215.227 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796149373; b=UWcdxEake2gvsgtvzNlUwgYKXXWfiKQFI9p/zcgdgfzfdIhidr+SBAVgKERU9x3J52k0 hZZQVtxHqF8++kf74ouQdswbMnqe/SO7MEM0VX1eXP6ytoZYZLXCpEVvUtC62YqXFNhXL 0BtpQzwABopTjSFr/O4SWYrr+wXzPniXEJAUbOhyfLjp85MUHcGuQRoNjwmDjx45i7eDV /9Y0aSjoR/ckzbHbuwdGeu22L5QyrE8Gd05Cs6NC5ngCcLepmT9PM63AHTyxCyiQYqnlm g8jMXqFePtKeUTxOwj+qvZ4uAeUYnJcebV5X3QJW+hGqkQEfrR508edVThgKRmtk4xg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796149373; h=DMARC-Filter:Received:X-Google-DKIM-Signature:X-Forwarded-Encrypted: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:X-Relaying-Domain: X-CFilter-Loop:Received:DKIM-Signature:X-Forwarded-Encrypted: X-Received:X-Received:Received:From:To:Cc:Subject:Date:Message-ID: X-Mailer:MIME-Version:Content-Transfer-Encoding: X-DetectorID-Processed; bh=AuFb5YgIMnmdsGdZCCZbU+HttLrlR+ucpI00gyOmpsM=; b=kzZzER+S4Gs3lMlFcWZdYlFVCuT7/UYiJtZaK1f9SDVVqZxdYyfZYEBvWP+OIFLpzu8Z V/fhBEEvKc6R1n19lJtYJnjh5hYEJwzRe/KOU72p7qynmOlg01WnkC35GZGfPfLloKXmC mDCyS3uc1oj8GGVtG8JQrSzgGa0ZY/TA/FwztWYSB/Rv6hU2lG/T127jYeAAa39D+BZ8v iBQ71sdWXJEuu8Z5w5ZyLlSAH4bt8mcS350FIQ/B+GxZMoJTa6vASvXoDwpOLZ39+qSkF FmZv2ruCtOGthCK2N0fgEgVrLuKVTPuSJjvYrKtU+PCTkv+FIW2cwyYjTYjslshYYcg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass header.d=broadcom.com header.i=@broadcom.com header.a=rsa-sha256 header.s=google header.b=MwOHbX83; arc=none smtp.remote-ip=209.85.215.227 Received: from mail-pg1-f227.google.com (mail-pg1-f227.google.com [209.85.215.227]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C562606A325 for ; Tue, 1 Dec 2026 18:22:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3C562606A325 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.a=rsa-sha256 header.s=google header.b=MwOHbX83 Received: by mail-pg1-f227.google.com with SMTP id 41be03b00d2f7-cc4be0e5351so7728388a12.0 for ; Tue, 01 Dec 2026 10:22:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796149372; x=1796754172; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to:content-type; bh=AuFb5YgIMnmdsGdZCCZbU+HttLrlR+ucpI00gyOmpsM=; b=Xf3je2rzv1Gsjr9yAEYi4nAOKxssbnusI2xO/uEY+Ih3mK62t9nTdBqjr3YG84obxe hyPJq579yjv9Jqp/8APc/F4iRqjqSQcm0fHjMWQ60wceVRnDYP3bp4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rckb3BXSM6Ejeig7tWqUOfvfF26gTuNaiBxR9Q us2HbIziHC+gJMk1ENK7yhxiIICATbiNA9S29VO4XhgRI= X-Received: by 2002:a17:90b:2c86:b0:3ac:b44c:2d84 with SMTP id 98e67ed59e1d1-3b41c8d5579mr38776753a91.13.1796149372126; Tue, 01 Dec 2026 10:22:52 -0800 (PST) Received: from smtp-us-east1-p01-i01-si01.dlp.protect.broadcom.com (address-144-49-247-100.dlp.protect.broadcom.com. [144.49.247.100]) by smtp-relay.gmail.com with ESMTPS id 98e67ed59e1d1-3b41ff67243sm12049959a91.3.2026.12.01.10.22.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Dec 2026 10:22:52 -0800 (PST) X-Relaying-Domain: broadcom.com X-CFilter-Loop: Reflected Received: by mail-pg1-f197.google.com with SMTP id 41be03b00d2f7-ce0f6cf2a01so826639a12.1 for ; Tue, 01 Dec 2026 10:22:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1796149370; x=1796754170; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=AuFb5YgIMnmdsGdZCCZbU+HttLrlR+ucpI00gyOmpsM=; b=MwOHbX83aMBGIvvGPePqUnKHV1jPmyfu3DihG26J7llOnaiOzVjGN4pSN0G72UfLIh ZL+oM5I3Ww3kpF1iRwCuDLzs6zzwHQI+d6Td5UBOXsUlklXjjYL4HqcQp8jUrHm0T3Uh UwWC9KuSCio9A+aQmU1pdF1KeJOqMLkBuC8XQ= X-Forwarded-Encrypted: i=1; AL+hErH9DKJ0LQ5ABuUoJ0LCAYsSODg8JQTwD+ae4svMmaIZrRhjOjWtlQaHGBHEW0KYej0b4XjoJnwwpdic@vger.kernel.org X-Received: by 2002:a05:6a21:7e0d:b0:3fb:2d3e:e61a with SMTP id adf61e73a8af0-4014b5642d5mr32442747637.30.1796149369966; Tue, 01 Dec 2026 10:22:49 -0800 (PST) X-Received: by 2002:a05:6a21:7e0d:b0:3fb:2d3e:e61a with SMTP id adf61e73a8af0-4014b5642d5mr32442725637.30.1796149369482; Tue, 01 Dec 2026 10:22:49 -0800 (PST) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8c87392d408sm20225242b3a.44.2026.12.01.10.22.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 10:22:48 -0800 (PST) From: Florian Fainelli To: netdev@vger.kernel.org Cc: Florian Fainelli , andrew+netdev@lunn.ch, andrew@lunn.ch, bcm-kernel-feedback-list@broadcom.com, bridge@lists.linux.dev, conor+dt@kernel.org, corbet@lwn.net, coreteam@netfilter.org, davem@davemloft.net, devicetree@vger.kernel.org, edumazet@kernel.org, fw@strlen.de, horms@kernel.org, idosch@nvidia.com, jonas.gorski@gmail.com, krzk+dt@kernel.org, kuba@kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, netfilter-devel@vger.kernel.org, olteanv@gmail.com, pabeni@redhat.com, pablo@netfilter.org, phil@nwl.cc, rafal@milecki.pl, razor@blackwall.org, rdunlap@infradead.org, robh@kernel.org, skhan@linuxfoundation.org, willemb@google.com Subject: [PATCH net-next v2 0/6] Add Northstar FA TCP/UDP NAT offload with a bridged LAN Date: Tue, 1 Dec 2026 10:22:21 -0800 Message-ID: <20261201182227.3990791-1-florian.fainelli@broadcom.com> X-Mailer: git-send-email 2.53.0 X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-DetectorID-Processed: b00c1d49-9d2e-4205-b15f-d015386d3d5e Add nftables flowtable offload for the original flow accelerator in BCM4708/BCM5301X. The six patches provide bindings, B53/DSA metadata and exception paths, cached-path validation and invalidation, the bgmac backend, KUnit tests and a hardware qualification guide. Support the usual router layout: a standalone WAN and an untagged LAN bridge containing four wired LAN ports and software members such as a PCIe WLAN interface. Wired IPv4 TCP/UDP SNAT or DNAT can use FA. Software members retain software forwarding. Two standalone DSA router ports also remain supported. Use distinct LAN/WAN router MACs, MTU 1500 and one hardware flowtable in the initial network namespace. Include only the physical wired DSA ports in the hardware flowtable. Data travels through GMAC2 and switch port 8 (IMP0). B53 CFP redirects TCP control, low-TTL, oversized and ingress-policy exceptions through GMAC0 and switch port 5 (IMP1), outside inline FA. Both protocols require this auxiliary connection. Router-domain and source-MAC guards preserve ordinary LAN switching and force continued tuples from another physical ingress through Linux learning. Table or classifier exhaustion retains software forwarding. Existing board device trees must explicitly opt in. Validate both actual cached routes, neighbours and bridge FDB paths. FDB notifications invalidate bridge flowtable generations, including software-only and hardware-capacity fallback owners after client moves. Retirement is conservative across bridge paths in the same namespace and across notified IPv4 route, rule and nexthop changes. Non-bridge caches retain their existing automatic route-validation policy. Unnotified DSCP-specific route aliases must not be used for accelerated traffic. Changes in v2: - Describe the GMAC3-hosted register window, restrict the GMAC2 consumer schema and correct the auxiliary CPU port name to IMP1. - Support the bridged-LAN router layout. Add shared source-MAC guards, preserve ordinary LAN switching and clear the forwarding mark on auxiliary redirects which may require software bridging. - Validate cached routes and neighbours without allocating entries; return the owner's reverse peer MAC for ingress guards. Resolve untagged bridge paths and permit STP state reads under RCU. - Notify caches around FDB changes and retire stale bridge generations during construction, packet lookup, GC and hardware admission, including software-only flows and hardware-capacity fallback. - Recheck every installed next hop, serialize block bookkeeping, reject non-initial namespaces and retire before ports can receive. - Match TCP control in both directions using exact tuples, including IP options, and close concurrent peer-installation races. Leave unparseable and non-initial fragments on the software path. - Handle guard failures, MAC-change vetoes, auxiliary VLAN membership and notifier teardown. Retire on bridge state and security changes. - Extend the combined KUnit suite to 37 cases and document bridge configuration, software-member tests and FDB movement qualification. - Fold intermediate fixes into their feature commits, wrap commit messages and remove redundant nftables transport matches. Every feature patch passes checkpatch.pl --strict without suppressions. - Repeat qualification and complete a fresh bridged-LAN mixed soak lasting 23 hours 58 minutes, including TCP/UDP capacity fallback. v1: https://lore.kernel.org/all/20261116222519.1416501-1-florian.fainelli@broadcom.com/ Dependencies: The base-commit trailer identifies the tested net-next snapshot. The five prerequisite-patch-id trailers identify independent fixes supplied in a separate prerequisite bundle, in this order: net: ethernet: bgmac: validate RX length against the DMA packet capacity netfilter: flowtable: do not forward frames not addressed to the host netfilter: flowtable: retain offload ownership until deletion completes net: dsa: tag_brcm: fix link-local detection with a prepended tag net: ethernet: bgmac: update netdev MTU after changing the MAC Validation on BCM953012ER / BCM53012: - ARM W=1 built-in, module and disabled builds, including module link and modpost; targeted DT schemas, examples and board DTBs. - 37 combined QEMU KUnit cases, including bridge movement, cache generation, source guards and the RCU STP accessor regression. - Classic, software-flowtable and hardware TCP/UDP SNAT/DNAT controls with payload, checksum, TTL and raw hardware-key checks. - Prior boundary, ingress-policy, invalidation and read/insert/delete completion-timeout qualification, with fallback and recovery. - Software-to-wired continued-tuple movement, simultaneous wired HW NAT and software-member NAT/L2 traffic, wrong-ingress trapping, FDB updates and bridge/auxiliary-link control transitions. - The new bridge soak completed 21 mixed-traffic phases and 20 cycles each of UDP overflow, aging, recovery, TCP overflow, FIN drain and TCP recovery. Its 132,404,736 wired echo exchanges and 1,538,648 exchanges on each software bridge stream had no loss or payload errors. All 144 periodic independent audits were healthy. There were no campaign restarts, host OOMs or unexpected kernel/FA errors. The software bridge member was a veth; no actual WLAN radio was tested. Traffic through every physical LAN port, BCM4708/BCM53011 hardware, FA2/FA+, PPPoE and maximum throughput remain outside this qualification. Earlier multicast-database diagnostics are tracked separately; the NAT soak does not establish a fix for them. Register accessibility still depends on the bootloader's GMAC3 state, as the binding and guide explain. OpenAI Codex assistance covered implementation, tests, documentation, changelogs, lab orchestration and submission preparation, using the requested design, Broadcom documentation, the ISC downstream driver, kernel sources and review feedback. Florian Fainelli (6): dt-bindings: net: describe the Northstar flow accelerator net: dsa: add Broadcom FA metadata and IPv4 exception paths net: flow_offload: allow drivers to validate and invalidate cached paths net: bgmac: add Northstar IPv4 TCP/UDP NAT flowtable offload net: add KUnit coverage for FA and flowtable path validation docs: net: document Northstar FA setup and NAT qualification .../bindings/net/brcm,bcm4708-fa.yaml | 52 + .../bindings/net/brcm,bcm5301x-gmac.yaml | 33 + .../ethernet/broadcom/bcm-ns-fa.rst | 638 +++++ .../device_drivers/ethernet/index.rst | 1 + MAINTAINERS | 7 + drivers/net/dsa/b53/Kconfig | 12 + drivers/net/dsa/b53/b53_common.c | 520 +++- drivers/net/dsa/b53/b53_fa_test.c | 124 + drivers/net/dsa/b53/b53_priv.h | 16 + drivers/net/dsa/b53/b53_regs.h | 39 + drivers/net/ethernet/broadcom/.kunitconfig | 24 + drivers/net/ethernet/broadcom/Kconfig | 39 + drivers/net/ethernet/broadcom/Makefile | 1 + .../net/ethernet/broadcom/bcm-ns-fa-test.c | 795 ++++++ drivers/net/ethernet/broadcom/bcm-ns-fa.c | 2218 +++++++++++++++++ drivers/net/ethernet/broadcom/bcm-ns-fa.h | 30 + drivers/net/ethernet/broadcom/bgmac-bcma.c | 5 + drivers/net/ethernet/broadcom/bgmac.c | 30 + drivers/net/ethernet/broadcom/bgmac.h | 2 + include/linux/dsa/brcm.h | 34 + include/net/dsa.h | 2 + include/net/flow_offload.h | 14 + include/net/netevent.h | 1 + include/net/netfilter/nf_flow_table.h | 13 +- include/net/netns/flow_table.h | 3 + net/bridge/br_fdb.c | 26 +- net/bridge/br_stp.c | 7 +- net/dsa/Kconfig | 23 + net/dsa/tag_brcm.c | 166 +- net/dsa/tag_brcm_test.c | 200 ++ net/netfilter/Kconfig | 15 +- net/netfilter/nf_flow_table_core.c | 57 +- net/netfilter/nf_flow_table_core_test.c | 203 ++ net/netfilter/nf_flow_table_offload.c | 143 ++ net/netfilter/nf_flow_table_offload_test.c | 242 ++ net/netfilter/nf_flow_table_path.c | 8 + net/netfilter/nft_flow_offload.c | 6 +- 37 files changed, 5712 insertions(+), 37 deletions(-) create mode 100644 Documentation/devicetree/bindings/net/brcm,bcm4708-fa.yaml create mode 100644 Documentation/devicetree/bindings/net/brcm,bcm5301x-gmac.yaml create mode 100644 Documentation/networking/device_drivers/ethernet/broadcom/bcm-ns-fa.rst create mode 100644 drivers/net/dsa/b53/b53_fa_test.c create mode 100644 drivers/net/ethernet/broadcom/.kunitconfig create mode 100644 drivers/net/ethernet/broadcom/bcm-ns-fa-test.c create mode 100644 drivers/net/ethernet/broadcom/bcm-ns-fa.c create mode 100644 drivers/net/ethernet/broadcom/bcm-ns-fa.h create mode 100644 net/dsa/tag_brcm_test.c create mode 100644 net/netfilter/nf_flow_table_offload_test.c base-commit: d1f4b7c6b997c29de67ad7178ababac2328cb1b4 prerequisite-patch-id: cc5740b3c0df34f00a185bc49b48af0de0b4f246 prerequisite-patch-id: 4a2aa7a8f7a1670091364bf8856b1286bdd4e371 prerequisite-patch-id: 4dac987af9eb210ace8e99bf06ce4273995692bb prerequisite-patch-id: d322079467996d4b88d7f928251d11869862b32a prerequisite-patch-id: bfc2b85226ebd6baac17d44e5909873c908e821c