* [PATCH net-next] net: dsa: qca8k: select two-byte headers during setup
@ 2026-11-24 1:43 Fil Dunsky via B4 Relay
2026-11-24 3:50 ` Fil Dunsky
0 siblings, 1 reply; 2+ messages in thread
From: Fil Dunsky via B4 Relay @ 2026-11-24 1:43 UTC (permalink / raw)
To: Christian Marangi, Andrew Lunn, Vladimir Oltean, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: netdev
From: Fil Dunsky <filipp.dunsky@gmail.com>
The QCA tagger handles two-byte switch headers, but setup only programs
per-port header enable modes. The global HEADER_CTRL length selector can
remain in four-byte mode when firmware configured it and no reset GPIO
is supplied. Software tagger selection then disagrees with the switch.
Clear the global four-byte selector before enabling CPU header ports or
registering the user MDIO bus. Preserve the identifier and all other
bits, and abort setup if the register update fails. The register access
uses the existing MDIO transport before an in-band management conduit
is available.
Both ISIS and ISISC document the length selector at bit 16 of register
0x98. This does not add support for the optional four-byte protocol.
Signed-off-by: Fil Dunsky <filipp.dunsky@gmail.com>
---
The QCA tagger always uses two-byte headers. Initialize the global switch
length selector to match before enabling CPU header ports, rather than
relying on firmware or an optional reset GPIO to have selected that mode.
The register layout is shared by the supported ISIS and ISISC families.
This is a standalone generic driver change and does not depend on the
Cortina platform, Ethernet, PCIe or board DTS series. It adds no new tagger
or hardware offload capability. The identifier and other register bits are
preserved.
The retained four-byte state mismatch was identified by source inspection;
no four-byte firmware failure has been observed on the Almond+ test unit.
ARM W=1 QCA driver/tagger builds pass on Linux 7.4 and Linux 6.18.64 with
the existing upstream MDIO error-handling prerequisites. Source-helper
fault-injection tests cover the early setup update and returned errors.
Full ARM kernel builds with QCA8K built in and as a module also pass.
An instrumented Linux RAM kernel on the Almond+ completed two QCA8337
initializations. The read-clear-read snapshots were 0x00000000 throughout,
with unrelated bits preserved. PHY reads, MDIO recovery and real MIB byte
counter progress passed, along with 600 byte-exact ordinary DSA UDP echoes
and 20 large ICMPv6 replies. The watchdog returned to the installed system.
This covers the existing two-byte path; retained-four-byte handover has
not been exercised. The source-helper fault tests remain software tests.
Target net-next for now: this is a source-identified initialization issue,
with no demonstrated regression or stable backport request. Maintainers
can reassess the target if further evidence warrants it.
---
| 8 ++++++++
| 2 ++
2 files changed, 10 insertions(+)
--git a/drivers/net/dsa/qca/qca8k-8xxx.c b/drivers/net/dsa/qca/qca8k-8xxx.c
index 382753bcc..15b97dee3 100644
--- a/drivers/net/dsa/qca/qca8k-8xxx.c
+++ b/drivers/net/dsa/qca/qca8k-8xxx.c
@@ -1865,6 +1865,14 @@ qca8k_setup(struct dsa_switch *ds)
return cpu_port;
}
+ /* The QCA tagger uses two-byte headers, regardless of firmware setup. */
+ ret = regmap_clear_bits(priv->regmap, QCA8K_REG_GLOBAL_HDR_CTRL,
+ QCA8K_GLOBAL_HDR_CTRL_LEN_4B);
+ if (ret) {
+ dev_err(priv->dev, "failed selecting two-byte QCA headers\n");
+ return ret;
+ }
+
/* Parse CPU port config to be later used in phy_link mac_config */
ret = qca8k_parse_port_config(priv);
if (ret)
--git a/drivers/net/dsa/qca/qca8k.h b/drivers/net/dsa/qca/qca8k.h
index 956338893..4740fcf39 100644
--- a/drivers/net/dsa/qca/qca8k.h
+++ b/drivers/net/dsa/qca/qca8k.h
@@ -149,6 +149,8 @@
#define QCA8K_PORT_STATUS_LINK_AUTO BIT(9)
#define QCA8K_PORT_STATUS_LINK_PAUSE BIT(10)
#define QCA8K_PORT_STATUS_FLOW_AUTO BIT(12)
+#define QCA8K_REG_GLOBAL_HDR_CTRL 0x098
+#define QCA8K_GLOBAL_HDR_CTRL_LEN_4B BIT(16)
#define QCA8K_REG_PORT_HDR_CTRL(_i) (0x9c + (_i * 4))
#define QCA8K_PORT_HDR_CTRL_RX_MASK GENMASK(3, 2)
#define QCA8K_PORT_HDR_CTRL_TX_MASK GENMASK(1, 0)
---
base-commit: b6a9fa34ce4187cb69d3c588a4bbffc31ce5db8f
change-id: 20261124-b4-qca8k-two-byte-header-init-60d7762968f2
Best regards,
--
Fil Dunsky <filipp.dunsky@gmail.com>
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH net-next] net: dsa: qca8k: select two-byte headers during setup
2026-11-24 1:43 [PATCH net-next] net: dsa: qca8k: select two-byte headers during setup Fil Dunsky via B4 Relay
@ 2026-11-24 3:50 ` Fil Dunsky
0 siblings, 0 replies; 2+ messages in thread
From: Fil Dunsky @ 2026-11-24 3:50 UTC (permalink / raw)
To: Christian Marangi, Andrew Lunn, Vladimir Oltean, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: netdev
Additional hardware validation on the Almond+ (QCA8337, MASK_CTRL 0x1302):
With the conduits down and all physical port MACs stopped, private test
instrumentation set only HEADER_CTRL bit 16 before the unchanged
regmap_clear_bits() in this patch. Readback confirmed 0x00010000 ->
0x00000000 on both initial probe and reprobe. The identifier remained zero.
The subsequent normal two-byte DSA path passed 600 byte-exact UDP echoes,
20 ICMPv6 replies, PHY/MIB checks and two Ethernet load/unload cycles.
Watchdog expiry returned to the installed OpenWrt, where LCD, networking
and watchdog checks passed. Flash was read-only throughout the RAM test.
The private instrumentation is not part of this patch.
Fil
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-24 3:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-24 1:43 [PATCH net-next] net: dsa: qca8k: select two-byte headers during setup Fil Dunsky via B4 Relay
2026-11-24 3:50 ` Fil Dunsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox