mirror of
https://github.com/openwrt/openwrt.git
synced 2026-10-20 20:06:00 +04:00
An offloaded flow never returns to the CPU, so nftables cannot mark it, and nothing configures the switch's queue classification. Add a procd service, reloaded when its config changes, that applies dcb dscp-prio maps on every DSA user port, sets the driver's small-packet parameters, and renders nssqos-style rules into tc flower filters with a DSCP pedit and an skbedit priority at prefs 256 to 510, on the uplink by default and on client ports only with mark_upload, since the ACL table holds 512 entries. The engine rewrites the whole TOS byte, so a rule is installed once per ECN codepoint and writes its codepoint back. Only the DNS rule is enabled by default; the game and call rules ship disabled as examples. A hotplug hook adds a clsact filter on each AP netdev that sets skb->priority 256..263 on small frames, so mac80211 keeps them out of best effort. small_pkt_len ships at 1000 bytes, which every MSS seen in 60 captured handshakes exceeds. The dscp maps need a kernel with DCB; the marking rules apply without it. Measured on IPQ8074 with a PPPoE uplink shaped to 305/165 Mbit/s, Waveform, three interleaved runs: +1/+0, +0/+0 and +1/+0 ms at 1000 bytes against +8/+3, +8/+1 and +6/+10 at 256; over Wi-Fi with an HE 160 MHz client, seven interleaved pairs, two runs without the filter exceeded 8 ms and none with it. A cs5 rule turns frames switched with ECN 0, 1, 2 and 3 into 0xa0, 0xa1, 0xa2 and 0xa3, where one rule per flow left 0xa0 on all four. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de> Link: https://github.com/openwrt/openwrt/pull/25700 Signed-off-by: Robert Marko <robimarko@gmail.com>