Commit Graph
72205 Commits
Author SHA1 Message Date
Qingfang Deng 7d0bf92bee mediatek: disable unsupported arch features
Both A53 and A73 are baseline-ARMv8.0 and do not support those features.

Signed-off-by: Qingfang Deng <dqfext@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26200
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 21:10:30 +01:00
Qingfang Deng 4d3ed016a2 mediatek: disable unrelated errata
MT7622 and MT798x (except MT7988) have a Cortex-A53 r0p4, as indicated
by /proc/cpuinfo. Disable errata that only apply to earlier revisions.

Signed-off-by: Qingfang Deng <dqfext@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26200
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 21:10:30 +01:00
Qingfang Deng 3d0cafad1c mediatek: disable perf events by default
The perf utility is not shipped by default. To use perf on a custom
build, enable KERNEL_PERF_EVENTS.

Signed-off-by: Qingfang Deng <dqfext@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26200
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 21:10:30 +01:00
Julius Bairaktaris 5df2651e6a generic: 6.18: add CONFIG_DETECT_HUNG_TASK_BLOCKER
Linux 6.15 added DETECT_HUNG_TASK_BLOCKER, which depends on
DETECT_HUNG_TASK. The generic config leaves DETECT_HUNG_TASK unset, so
the symbol stays hidden by default, but selecting
KERNEL_DETECT_HUNG_TASK makes it visible and the kernel build stops at
the syncconfig prompt for it. Add it to the generic config.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/26012
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 21:08:13 +01:00
João Silva 6ca8a7f1d5 realtek: pie: rtl930x: fix template 4 source port fields
The software description of RTL930x fixed template 4 lists SPM1 twice,
but the hardware template contains SPM0 followed by SPM1. This encodes
the upper source-port bitmap word into both fields, losing the lower
16 source-port match bits and their mask.

Describe the two fields as SPM0, SPM1 so IPv6 source-address rules using
this template match the intended ingress ports.

Signed-off-by: João Silva <jgc3silva@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26226
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
2026-10-26 20:48:59 +01:00
João Silva 0074cd9b1d realtek: pie: preserve two-bit L2 frame type fields
The PIE L2 frame type and its mask occupy two bits in hardware, but their
pie_rule members are bool. Assigning LLC_Other (2) or a full mask (3)
therefore truncates the value to 1 before the encoders can pack it.

Use u8 for frame_type_l2 and frame_type_l2_m so all four switch families
preserve the complete match and mask values during encoding and readback.

Signed-off-by: João Silva <jgc3silva@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26225
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
2026-10-26 20:46:03 +01:00
Jakub Skoczen 3c3a415069 kirkwood: fix ReadyNAS Duo v2 fan controller detection
The hwmon index is not stable across boots. On the
ReadyNAS Duo v2, hwmon0 is the kirkwood_thermal sensor
while the g762 fan controller is registered as hwmon1.

Find the fan controller by its hwmon name instead of
assuming a fixed index.

Signed-off-by: Jakub Skoczen <skoczko@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26206
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 15:14:00 +01:00
John Audia 6079d00acd intel-microcode: switch source to Intel upstream, update to 20260925
Debian tarball lags/currently 5 commits and 9 months old
relative to upstream. Worse is that upstream is asleep at
the switch with 3 outstanding bug reports since Feb/2026
showing them this fact[1-3].

Therefore use intel/Intel-Linux-Processor-Microcode-Data-Files
directly and drop the Debian-supplied make step.

1. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1149038
2. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1136460
3. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1144154

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/26184
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 14:52:09 +01:00
Alex Sunekants b5ff052caf ramips: mt7621: fix SATA detection on MQMaker WiTi
The WiTi's SATA controller worked under OpenWrt 19.07, but
stopped being detected in the 21.02 release series following
changes to the MT7621 PCIe driver. PCIe port 2 fails to
initialise, leaving the onboard ASMedia ASM1062 inaccessible.

This adds the missing board-specific reset GPIOs (19, 8 and 7).
The mapping was originally suggested by Sergio Paracuellos
and tested by Florian Hofmann in the earlier issue discussion.

I've tested the fix on a WiTi v2.0 (256 MB) with both OpenWrt main
(Linux 6.18.55) and the 25.12 branch (Linux 6.12.112).
Both SATA ports negotiated 6 Gbps links, and I was able to
read from two connected SSDs without errors.

Hope this helps anyone who is still using one of these boards
for anything.

Link: https://github.com/openwrt/openwrt/issues/9156
Link: https://github.com/openwrt/openwrt/issues/9869
Signed-off-by: Alex Sunekants <asunekants@pm.me>
Link: https://github.com/openwrt/openwrt/pull/26196
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 14:44:18 +01:00
Josef Schlehofer 2462519a7f mac80211: realtek: relax 8822B 2.4 GHz ETSI EDCCA threshold
Under ETSI, rtw88 sets the RTL8822B EDCCA threshold to min(IGI, 36),
at most about -74 dBm. On a Turris 1.x with a TP-Link Archer T4U v3
(RTL8812BU) in USB 3 mode as a 2.4 GHz AP under CZ, in-band energy,
mostly from the adapter's own USB 3 link, kept IGI at 0x2a and the
threshold at 36. The AP was not seen in any of 5 scans, and the
driver reported "failed to get tx report from firmware".

Add the pending upstream patch that uses the normal threshold,
max(IGI + 8, 48), on 2.4 GHz under ETSI, capped at 50 (nominally
-60 dBm), and keeps the existing rule on 5 GHz and in JP. With it,
the AP was seen in 4 of 5 scans on the same port and boot (16 of 19
across repeated runs), with no TX report failures. Only the line
numbers are adapted to backports 7.2.

Pending upstream, submitted to rtw-next and acked by Ping-Ke Shih:
https://lore.kernel.org/linux-wireless/20261011204509.46062-1-pepe.schlehofer@gmail.com/

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/25836
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2026-10-26 13:38:47 +01:00
Josef Schlehofer a40fd94a3f mac80211: realtek: download rsvd page synchronously on USB
In AP mode, rtw88 downloads the reserved page, which holds the beacon,
and then polls BCN_VALID. Over USB the download only queues the URB, so
the poll can run while the beacon is still on the bus and time out, in
bursts when the beacon changes often, such as when stations associate
and disassociate (lwfinger/rtw88#451):

    rtw_8822bu: error beacon valid
    rtw_8822bu: failed to download drv rsvd page

Add v5 of the rtw88 patch. It waits for that URB in a new
rtw_usb_write_port_sync() and kills it if it does not complete within
5 s, as usb_bulk_msg() does, but keeps URB_ZERO_PACKET. This fixes the
use-after-free that Ping-Ke Shih found in v3, where the completion
handler could run after the waiter had freed its context on timeout.
Only the line numbers and one context line differ from rtw-next.

v4 was tested with backports 7.2 on a Turris 1.x with a TP-Link Archer
T4U v3 (RTL8812BU, handled by rtw_8822bu) as a 2.4 GHz AP over USB 2 and
USB 3 and as a 5 GHz AP over USB 3. The AP came up after each of 15
restarts, and no "error beacon valid", "failed to download drv rsvd
page" or USB write error was logged during them or 7 beacon changes. No
station was associated, and the builds without the patch did not log
these errors either, so this shows no regression; lwfinger/rtw88#451
itself was not reproduced. v5 only reorders declarations, drops an
initializer and rewords a comment.

Pending upstream, submitted to rtw-next and acked by Ping-Ke Shih:
https://lore.kernel.org/linux-wireless/20261013033737.6761-1-pepe.schlehofer@gmail.com/

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/25837
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2026-10-26 13:37:43 +01:00
Julius Bairaktaris a41558d2d3 qualcommax: list UNIPHY clock output names RX first
qca_uniphy_register_clks() registers each clock under the
clock-output-names entry at its UNIPHY_CLK_* index, and the binding
header defines UNIPHY_CLK_RX as 0. The ipq6018 and ipq8074 nodes list
the TX name first, so the RX clock carries the TX name and vice versa.
Since GCC takes these clocks by phandle, debugfs reports every port TX
RCG on uniphyN_gcc_rx_clk while the hardware selects uniphyN TX, and a
parent lookup by name picks the wrong one. List the names RX first, as
ipq5018 already does, and make the binding match.

Tested on a Xiaomi AX3600 (ipq8074): nss_port1..5_tx_clk_src now report
uniphy0_gcc_tx_clk and the RX sources uniphy0_gcc_rx_clk, matching CFG
src 1 in their parent maps. The CFG registers and all rates are
unchanged, and lan1 to lan2 iperf3 runs at 941 Mbit/s in each direction
(one 5 s run each).

Fixes: 5df1a6ab80 ("qualcommax: ipq60xx: pass UNIPHY clocks directly to GCC")
Fixes: 49193000bf ("qualcommax: ipq807x: pass UNIPHY clocks directly to GCC")
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/26205
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 12:50:31 +01:00
Ronald Ouyang c5e88157e9 ath79: use old SPI driver on WD MyNet to avoid filesystem errors
complaints about JFFS2 corruption on WD Mynet N750 devices started at 21.02.
https://forum.openwrt.org/t/upgrade-from-barrier-breaker-14-07-to-latest-21-02-wd-my-net-n750/119833/

it's still happening on 25.12, from my device:
jffs2: notice: (594) jffs2_get_inode_nodes: Node header CRC failed at 0x006e9c.
jffs2: notice: (723) jffs2_get_inode_nodes: Node header CRC failed at 0x006e58.
jffs2: warning: (723) jffs2_do_read_inode_internal: no data nodes found for ino #37
ffs2: notice: (723) jffs2_do_read_inode_internal: but it has children so we fake some modes for it

commit ebf0d8dade (between 19.07 and 21.02) started using the new
spi-ar934x driver for the ath79 target instead of spi-ath79.

i don't know exactly what's wrong with the new driver with this device.
but putting it back to the old one seems to fix it.

I've been using my N750 successfully now for a week, changing configs,
installing/removing packages, rebooting, yanking power.
I don't get any more JFFS2 complaints, the device stays responsive and
LUCI is usable as expected

Signed-off-by: Ronald Ouyang <repaxan@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26154
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2026-10-26 11:35:35 +01:00
Andrew LaMarche 76d6b7fdbf octeon: fix PEM BAR register map on CN70XX
On CN70XX, the PEM register map differs from the other Octoen III models.
PEM_BAR_CTL is at block offset 0xa0 and the BAR1 index table at 0x100, while
the in-tree code uses the CN68XX offsets (BAR_CTL at 0x128, BAR1 index at 0xa8)
for all Octeon III parts. The Cavium OCTEON-SDK cvmx-permx-defs.h special cases
CN70XX for both registers.

With the generic offsets, __cvmx_pcie_rc_initialize_gen2() programs the wrong
registers on CN70XX. The intended BAR_CTL value lands on a BAR1 index entry,
and the BAR1 index writes land on the real BAR_CTL (0xa8) and BAR2_MASK (0xb0).
BAR2_MASK is ANDed with inbound (device DMA) addresses, so a bogus value there
silently corrups all PCIe DMA to host memory. Observed on a CN7030 board while
debugging a failing b43 firmware intialization followed by DMA errors.

Add model awareness helpers and use them for the three affected addresses.

Signed-off-by: Andrew LaMarche <andrewjlamarche@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26198
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 10:09:42 +01:00
Robert Marko 189012aed9 qualcommax: refresh patches
CI told us we need to do so, so lets do it.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 09:57:39 +01:00
Robert Marko e2e50c9dc4 firewall4: update to Git HEAD (2026-10-26)
df0c9021bbe7 ruleset: fix for missing counters handling code for ipsets
bac1d656e09b Do not emit helper jump without helper modules

Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 09:51:35 +01:00
Julius Bairaktaris c7924dcd74 generic: dsa: track host fdb entries per port
When a bridge fdb entry roams between ports, br_fdb_update() notifies
switchdev of the deletion and the addition without a lock, and DSA's
host address count on the CPU port goes wrong when two CPUs learn one
address on different ports: "qca-ppe 3a000000.ppe: port 5 failed to
delete ... from fdb: -2", and an address left on the CPU port.

Backport the series prepared for net-next that makes each DSA user port
record the host addresses it holds and look up where the bridge has the
entry when it handles each event, without a lock in the bridge's
learning path.

Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24806
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 09:44:48 +01:00
Julius Bairaktaris 09fe0f8140 generic: flowtable: check the bridge a roaming flow transmits on
Update the imported fdb roaming teardown to v9. With a vlan device of one
bridge enslaved to another bridge, v8 counted the vlans below both
bridges, looked the bridge port up from the wrong device and read past
encap[]; v9 resets the count at each bridge, so the gc checks the bridge
the flow transmits on. v9 also carries Pablo's authorship and sign-off
from his posting with a note of the changes, instead of Co-developed-by.

Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24806
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 09:44:47 +01:00
Julius Bairaktaris be75fbfa9b kernel: backport the flowtable VLAN ID fix
Backport c203ecf90574, which keys the flowtable tuple on the 12-bit VLAN
ID instead of the whole TCI, so that frames whose tag carries a PCP
still match their flow.

Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24806
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 09:44:47 +01:00
Julius Bairaktaris b50530932b qualcommax: tag with the QCA header instead of out of band
The out-of-band tagger was never merged upstream: it carries the port in
an skb extension that DSA allocates for every frame sent, and that
qca_edma allocated for every frame the switch trapped to the CPU. Use the
QCA tagger instead, as airoha and mtk_eth_soc use their switch's in-band
tagger. On transmit, qca_edma reads the port out of the two-byte tag and
removes it once the frame is sure to go out, then names the port in the
preheader as before. On receive, a forwarded frame keeps the metadata dst
that DSA resolves without a tagger, and only a trapped frame, which the
bridge has to forward itself, gets the header the tagger reads its port
from. The switch's frames for a flow reach qca_ppe through a hook it
registers with qca_edma, and its shaper devices pass the port to
qca_edma_port_xmit() directly, so the shaped path allocates nothing per
packet. The tagger's needed headroom raises the conduit's MTU by 2.

Wired LAN, a VLAN-aware bridge, IGMP snooping with offloaded MDB
entries, PPPoE over a VLAN uplink and Wi-Fi through the CPU port work
unchanged on a Xiaomi AX3600.

Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24806
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 09:44:47 +01:00
Julius Bairaktaris 698653058f qualcommax: qca_edma: moderate receive interrupts over 100 us
At a shaped 330 Mbit/s download each receive interrupt found 2.4 frames,
the 25 us moderation timer expiring long before the 16-frame threshold.
With 100 us it finds 6.7 (3.5 for the upload), and the router spends
4.4 % fewer CPU cycles per forwarded packet on the download, with the
same throughput and latency under load (Flent tcp_ndown 8 through CAKE,
3 runs each; the upload's 1.8 % is within the 3 % that two identical
configurations differ by). ethtool -C still sets it.

Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24806
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 09:44:47 +01:00
Julius Bairaktaris 6cadbf46d3 qualcommax: qca_ppe: run CoDel's control law on the shaped queues
The queue manager drops a frame only on arrival, against a limit in
buffers, so it bounds a queue but cannot tell a standing queue from a
burst. A kthread reads the depth of every hashed queue of a shaped port
and of the CPU port's download band, takes each bottleneck's delay from
its backlog and rate, and when CoDel's law calls for a drop lowers the
limit of each busy queue of that bottleneck to one frame under its depth
for one tick. It ticks every 2 ms while a queue holds a full frame and
every 20 ms otherwise; aqm_tick_us=0 turns it off, and debugfs aqm shows
its state.

Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24806
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 09:44:47 +01:00
Julius Bairaktaris c31a509a4d qualcommax: qca_edma: pick a multiqueue shaper's queue by the receive ring
edma_rx_flow() hands a frame of an offloaded flow to its egress before
the receive queue was recorded, so with cake_mq on the IFBs every such
frame took the same queue. Record the ring first, so that each ring's
CPU feeds a CAKE instance of its own.

Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24806
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 09:44:47 +01:00
Julius Bairaktaris be8b18e401 qca-ppe-qos: name ppe_cake.qos in the package description
The classifiers pair with sqm-scripts' ppe_cake.qos as they do with
hw_ppe.qos.

Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24806
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 09:44:47 +01:00
Julius Bairaktaris 8099efef18 qualcommax: qca_ppe: hand shaped flows to a qdisc after the hardware routed them
The PPE has no queue that can run CAKE or mark ECN. A flow that crosses
the shaped WAN link now keeps its lookup, NAT and encapsulation in
hardware, and its finished frames reach the CPU only to pass a qdisc on
a shaper device, one per direction, which the driver creates when the
devlink parameter dl_shaper or ul_shaper names a device that does not
exist yet. The PPE builds an upload frame whole, PPPoE and VLAN headers
included. Once the qdisc releases a frame for a switch port, the shaper
device sends it straight into the conduit's ring; a download to Wi-Fi
goes on to that interface. What the host forwards itself reaches the
same devices through act_mirred, as it would reach an ifb: from the
uplink's egress, where the upload device builds the uplink's PPPoE and
VLAN headers itself and sends the frame to the conduit too, and from the
WAN port's ingress, from where the download device returns it to the
receive path. Upload frames carry the conntrack the hardware path would
otherwise lose, so CAKE's nat mode still tells the LAN hosts apart; a
download to a tagged LAN VLAN gets its tag after the shaper. An ifb
named instead works as well, at a higher cost. The devlink parameters
dl_shaper, ul_shaper, uplink and ct_dscp configure it, and sqm-scripts'
ppe_cake.qos sets them.

Flent from a wired client over a 300/150 Mbit/s PPPoE line shaped to
330/168, 8 TCP streams each way: through the shaper devices the download
carries 307.4 Mbit/s and the upload 157.2, as through IFBs, and the
router spends 13.4k CPU cycles per forwarded download packet instead of
15.8k and 18.2k per upload packet instead of 22.4k; the four cores' load
taken from idle-priority spinners falls from 26.5 to 21.6 % on the
download and from 19.4 to 15.8 % on the upload. Latency under load
stays at idle at the median through both; its 99th percentile rose by
0.05-0.07 ms in six of seven runs and by 4.3 ms in one (3 runs each
arm).

Link: https://github.com/tohojo/sqm-scripts/pull/196
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24806
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 09:44:47 +01:00
Julius Bairaktaris bddefbe965 qca-ppe-qos: end the rule range at preference 509
The driver ranks a lower preference higher, so a filter at 511, where
hw_ppe.qos marks its download band, ranks below every rule of this
script, not above as the comment said. Stop the range at 509, below the
small-packet rule's rank, and still flush up to 510, which earlier
versions installed rules at.

Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24806
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 09:44:47 +01:00
Julius Bairaktaris be48899f48 qca-ppe-qos: let 'enabled' switch only the marking rules
With enabled set to 0 the script tore everything down, the DSCP maps and
the small-packet priority included, and skipped the Wi-Fi stamp, while
the LuCI page offers the option as the switch for the marking rules.
Keep the maps and the small-packet priority, and only flush the marking
filters.

Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24806
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 09:44:47 +01:00
Julius Bairaktaris fadbcb65d5 qca-ppe-qos: keep PSH segments out of the Wi-Fi small-packet stamp
The u32 stamp moves short frames into a higher access category, so a
short TCP segment with PSH, which ends a write of a bulk flow, overtakes
the flow's full-size segments. A download over Wi-Fi saw 240-460
reordered segments per 25 s, and none with two pass filters ahead of the
stamp for TCP segments with PSH set (3 runs each). The filters use fixed
offsets, so they cover IPv4 without options and IPv6 without extension
headers.

Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24806
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 09:44:47 +01:00
Julius Bairaktaris 68e25f82b1 qualcommax: qca_ppe: keep PSH segments out of the small-packet priority
A short TCP segment that carries PSH ends a write of a flow whose other
segments are full size. Promoted by the small-packet rule, it overtakes
them and reorders the flow on every write: a 16 Mbit/s download through
the switch saw 35-42 reordered segments per 30 s, and none once the rule
matches only frames with PSH clear (2-3 runs each). Acks, handshakes and
every protocol other than TCP, whose frames carry no TCP flags, still
match.

Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24806
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 09:44:47 +01:00
Julius Bairaktaris d6c75fb809 qualcommax: qca_ppe: read an FDB lookup's entry before retiring its result
The FDB read results queue up: the data registers show the oldest, and
reading the result register retires it. The driver polled the result
register and then read the data, which by then was zero, so every
lookup missed. A port_mdb_add therefore always started the group from
the CPU port alone and added another entry for the same group, and a
group with members on two ports was split over entries that each named
one of them.

Read the data before the result register in each poll, so the data read
just before the result that names the operation is its entry.

On an AX3600 with IGMP snooping, a group joined from lan1 and lan2 had
six hardware entries, naming CPU and lan1 or CPU and lan2, and lan1
received none of the group's traffic; a lookup by hand returns the entry
when its data is read first.

Fixes: 0f9baab7f6 ("qualcommax: qca_ppe: finish an FDB operation before reading its result")
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24806
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 09:44:47 +01:00
Julius Bairaktaris 00ad5b5384 qualcommax: qca_ppe: route flows to Wi-Fi through the CPU port
A flow out of a device the switch cannot reach, such as a Wi-Fi
interface, was left to the software flowtable. Offload it with the CPU
port as the egress port: the PPE routes and translates it and rewrites
the Ethernet header, and the frame reaches the CPU finished, with the
index of the flow it matched in the receive preheader. qca_edma hands
such frames to the switch driver ahead of GRO, which queues them on the
flow's egress device, so its qdisc, AQL and airtime fairness see them as
before. Routed TCP to a 2x2 HE160 station costs 27% fewer CPU cycles per
packet over IPv4 (2 runs) and 23% fewer over IPv6 (1 run). The cpu_xmit
module parameter turns it off.

Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24806
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 09:44:47 +01:00
Julius Bairaktaris 33f270e580 qualcommax: qca_ppe: give a PVID-classified frame the VLAN's VID
On a VLAN-aware bridge, a frame that arrives untagged on a port and is
classified into its PVID VLAN carries no VID, so a port that egresses the
VLAN tagged sends it with VID 0. Unicast between an untagged and a tagged
port of the same VLAN therefore never arrives. Let the PVID rule add the
VLAN's VID to the frame.

On an AX3600 with lan1 untagged in VLAN 1 and lan2 carrying VLAN 1
tagged, the PC's frames left lan2 tagged with VID 0 and its ping to a host
behind lan2 failed; with the VID added, ping and TCP pass both ways.

Fixes: 142104bb90 ("qualcommax: add PPE driver")
Link: https://github.com/openwrt/openwrt/issues/25904
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24806
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 09:44:47 +01:00
Julius Bairaktaris 2ca23dee66 qualcommax: qca_edma: prefetch the next segment of a frag_list frame
Counting the descriptors of a frag_list frame walks its segments, and
each one misses on the skb and then on its shared info. Prefetch the next
segment while the current one is counted.

Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24806
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 09:44:47 +01:00
Julius Bairaktaris dd1227705a qualcommax: qca_edma: read a descriptor in one access
The descriptor rings are uncached, and the receive peek and the transmit
completion walk read a descriptor's address and status as separate 32-bit
loads, the completion walk its status up to three times. Read both words
with one 64-bit load.

Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24806
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 09:44:47 +01:00
Julius Bairaktaris fee126ace8 qualcommax: qca_ppe: correct stale and wrong comments
Several comments no longer matched the code: the qdisc band map claimed
nothing is programmed, the highest classifier priority was explained by a
node sharing that was removed, the shaper state was described as tbf only,
the root tbf comment sat above the gred code, the CPU port's admission
comment said its scheduler is not built, and the ACL comment had ethtool
inserting without rtnl, which it holds. Others narrated history or said
FIXME. Correct or trim them.

Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24806
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 09:44:47 +01:00
Julius Bairaktaris 94b8093937 qualcommax: qca_ppe: refuse mqprio frame preemption
mqprio's preemptible traffic classes were accepted and ignored. The MACs
have no frame preemption, so refuse them.

Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24806
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 09:44:47 +01:00
Julius Bairaktaris 6b9c6c5b6c qualcommax: qca_ppe: look a port's scheduler layout up in one place
Ten functions searched port_l0[] for the port with the same loop. Give
the search a helper.

Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24806
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 09:44:47 +01:00
Julius Bairaktaris 8948da3242 qualcommax: qca_ppe: keep a replacing mqprio's offload
tc qdisc replace of an offloaded mqprio installs the new qdisc first and
then destroys the old one, whose offload removal carries no qdisc and
cleared the shapers and the transmit queue mapping the new qdisc had
just set. Count the port's offloaded mqprio qdiscs and ignore a removal
while another one is installed.

Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24806
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 09:44:47 +01:00
Julius Bairaktaris fcd37e330b qualcommax: qca_ppe: refuse an mqprio class that splits a hashed band
A priority selects a band of four queues and the flow hash picks the
queue in it, but mqprio's map was checked against priority i leaving on
queue i, a layout from before the hash spread. A class of one queue then
passed the check and shaped a quarter of its priority's flows, chosen
by hash. Require each class to own the whole band its priorities select.
hw_ppe's map, 8@0 4@8, still passes.

Fixes: 3881df344e ("qualcommax: qca_ppe: spread flows across queues by RSS hash")
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24806
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 09:44:47 +01:00
Julius Bairaktaris 680b285834 qualcommax: qca_ppe: count only switched traffic in offloaded qdisc stats
The root tbf, ets and prio stats add the MAC's transmit counters to the
qdisc's, but the MAC also sends every frame the host put through that
qdisc, which the qdisc has counted itself, so host traffic was reported
twice. Subtract what the host sent on the port over the same interval.

On a WAN port with an offloaded tbf, the qdisc reported the MAC's bytes
plus its fq_codel child's before, and reports 177955309 bytes against the
MAC's 177957143 after.

Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24806
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 09:44:47 +01:00
Julius Bairaktaris fd5484ac49 qualcommax: qca_ppe: drop dead checks and accept an ethernet-ports node
ppe_vlan_find() was declared twice, and four ethtool callbacks checked
the port against num_ports, which DSA never exceeds. Probe and the
IPQ6018 mux setup looked for a "ports" node only, while the binding and
the DSA core also accept "ethernet-ports". Drop the duplicate and the
dead checks, and look for both names.

Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24806
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 09:44:47 +01:00
Julius Bairaktaris 2ebcefb752 qualcommax: qca_ppe: share the FDB operation code
The unicast and multicast FDB writes repeated the op engine sequence, the
MAC packing was written out three times, and the LAG FDB ops copied the
port ones apart from the destination. The LAG copies also took flow_lock,
which guards none of the FDB state; fdb_lock already serialises the op
engine. Share the op engine write, the MAC packing and one FDB set helper
that the port and LAG ops call.

Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24806
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 09:44:47 +01:00
Julius Bairaktaris 91ccd0713d qualcommax: qca_ppe: fold the CPU port's queue counters periodically
The fold work visits user ports only, so the CPU port's queue counters,
32 bits of packets and 40 of bytes, were folded only when ethtool read
them. At 1 Gbit/s the byte counter wraps in about 2.4 hours, and two
wraps between reads lose a whole period. Fold every available port.

Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24806
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 09:44:47 +01:00
Julius Bairaktaris bbb0d915e0 qualcommax: qca_ppe: keep a group's members when its lookup times out
port_mdb_add starts a group from the CPU port alone on any lookup
error, so an operation that timed out rewrote an existing group with
only the CPU and the new port, dropping every other member. Start afresh
only when the group does not exist and pass any other error up.

Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24806
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 09:44:47 +01:00
Julius Bairaktaris c6a86d76b9 qualcommax: qca_edma: correct two comments
The transmit completion walk carried two comments saying the same thing,
and the checksum comment read as if the driver accepted a padded frame's
sum, where it leaves the frame to software. Merge the first pair and
restate the second.

Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24806
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 09:44:47 +01:00
Julius Bairaktaris 62792fff96 qualcommax: pcs-qca-uniphy: fix macro and clock callback slips
to_qca_uniphy_pcs() ignored its argument and ended in a semicolon, the
port clock index macros lacked outer parentheses, the reference clock's
init fields were chained with commas, and recalc_rate returned -EINVAL as
a rate for an unknown UNIPHY. Use the argument, parenthesise the macros,
end the statements and report a rate of 0. Drop the unused rst_ahb.

Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24806
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 09:44:47 +01:00
Julius Bairaktaris f3aac46ea7 qualcommax: declare what the PPE and EDMA drivers build on
QCOM_80211AX_PPE registers a DSA switch on the out-of-band tag, takes its
PCS from the UNIPHY driver and its registers through regmap, and QCOM_EDMA
uses the out-of-band tag's skb extension and page_pool, but neither says
so: they only build because the target config enables all of it. Add the
dependencies and selects.

Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24806
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 09:44:47 +01:00
Julius Bairaktaris 6914ff44db qualcommax: qca_edma: copy a transmitted head only when it is shared
Transmit reallocated the head of every cloned skb before writing the
preheader into its headroom, although a clone whose header was released,
as TCP's are, may have its headroom written. Use skb_cow_head(), which
copies the head only when the header is shared or the headroom is short.

Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24806
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 09:44:47 +01:00
Julius Bairaktaris 6d5c244683 qualcommax: qca_edma: mark frames the switch forwarded itself
The out-of-band tagger never sets offload_fwd_mark, so the bridge floods
every broadcast, multicast and unknown unicast frame from a switch port
again in software, after the PPE has flooded it in hardware. Frames the
switch forwarded or flooded to the CPU carry CPU code 0 in the receive
preheader; hand those up with a METADATA_HW_PORT_MUX dst naming their
port, as mtk_eth does, so DSA marks them and the tagger's skb extension
is not allocated. A frame the switch trapped keeps its CPU code, goes
through the tagger and stays unmarked, so the bridge still forwards it.

On an AX3600, 1000 broadcasts sent on lan2 left lan1 and lan3 2000 times
each before and 1000 times after (3 runs), and 256 IGMP reports, which
the switch traps, left each of them 256 times (3 runs).

Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24806
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 09:44:47 +01:00
Julius Bairaktaris 3ce1d9eb18 qualcommax: qca_edma: read the next frame's headers ahead
Every received frame stalled on its first read of the preheader and the
headers behind it, which the receive sync had just evicted from the
cache. Read the next descriptor while the current frame is processed,
sync its frame for the CPU and prefetch its first two cache lines.

Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24806
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-10-26 09:44:47 +01:00