openwrt-pf/target/linux
Qingfang Deng 32462ea5b2 kernel: fix WED offloaded flow timeout refresh
Add a pending patch to fix the WED flow timeout.

OpenWrt has recently migrated many platforms to kernel 6.18. On the
MediaTek platform, which supports hardware network offloading, WiFi
connections accelerated via the WED path were observed to drop after
roughly 300 seconds.

After several debugging sessions, assisted by the Claude LLM, the
problem was narrowed down as follows:

nf_flow_table_extend_ct_timeout() extends ct->timeout for offloaded
flows using:

	cmpxchg(&ct->timeout, expires, new_timeout);

'expires' comes from nf_ct_expires(ct) and is a relative value, while
ct->timeout holds an absolute timestamp. The two are never equal, so
the cmpxchg always fails and the timeout is never extended.

This goes unnoticed for most flows, but a long-lived hardware (WED)
offloaded flow on MediaTek MT7986 eventually has ct->timeout decay to
zero, the conntrack entry is reaped and the connection breaks.

Open-code the relative value from a single READ_ONCE(ct->timeout)
snapshot and compare against that same absolute snapshot in the
cmpxchg, so the timeout extension actually takes effect while the
datapath remains authoritative if it updates ct->timeout concurrently.

Signed-off-by: Qingfang Deng <dqfext@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23611
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-06-04 22:42:02 +02:00
..
airoha airoha: enable 6.18 testing kernel 2026-06-03 09:06:35 +02:00
apm821xx apm821xx: slightly improve routing performance 2026-05-25 10:16:50 +02:00
armsr armsr: enable 6.18 as a testing kernel 2026-05-25 22:12:04 +02:00
at91
ath79 kernel: bump 6.12 to 6.12.92 2026-06-02 21:15:21 +02:00
bcm27xx kernel: bump 6.12 to 6.12.92 2026-06-02 21:15:21 +02:00
bcm47xx bcm47xx: base-files: hack sysinfo to allow ASU sysupgrades 2026-05-25 23:27:34 +02:00
bcm53xx bcm53xx: enable 6.18 testing kernel 2026-05-24 20:36:09 +02:00
bcm4908
bmips
d1
econet econet: add EN751627 subtarget and Zyxel EX3301-T0 board 2026-05-14 21:12:46 +02:00
gemini
generic kernel: fix WED offloaded flow timeout refresh 2026-06-04 22:42:02 +02:00
imx imx: add support for Kontron OSM-S/BL i.MX8MP 2026-06-01 17:49:36 +02:00
ipq40xx kernel: bump 6.18 to 6.18.34 2026-06-02 21:14:04 +02:00
ipq806x ipq806x: fix caldata loading for mr42/mr52 2026-05-18 21:14:22 +02:00
ixp4xx
kirkwood
lantiq kernel: bump 6.18 to 6.18.33 2026-05-25 21:04:53 +02:00
layerscape
loongarch64 loongarch64: add upstream dwmac-loongson patches for 2K3000/3B6000M 2026-05-26 00:58:05 +02:00
malta
mediatek mediatek: mt7622: enable CONFIG_MTD_VIRT_CONCAT 2026-06-01 00:32:38 +02:00
microchipsw
mpc85xx
mvebu mvebu: cortexa53: uDPU/eDPU: update active bootscript as well 2026-05-26 19:35:42 +02:00
mxs
octeon octeon: drop v6.12 and default to v6.18 2026-05-23 19:13:22 +02:00
omap
pistachio
qoriq qoriq: drop kernel config for 6.12 2026-05-24 23:43:54 +02:00
qualcommax qualcommax: refresh patches 2026-06-04 22:37:30 +02:00
qualcommbe qualcommbe: 6.18: refresh config 2026-05-28 10:47:03 +02:00
ramips ramips: add support for ELECOM WMC-C2533GST 2026-05-29 08:27:50 +02:00
realtek realtek: clk: change to __raw reads and writes 2026-06-01 19:17:58 +02:00
rockchip rockchip: enable maskrom button for NanoPi R5C/R5S 2026-05-29 08:29:03 +02:00
sifiveu
siflower
starfive kernel: bump 6.18 to 6.18.33 2026-05-25 21:04:53 +02:00
stm32
sunxi
tegra
uml
x86 x86: onie-installer: wire up sysupgrade via ONIE install mode 2026-05-23 17:23:54 +02:00
zynq
Makefile