openwrt-pf/target/linux/generic
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
..
backport-6.12 kernel: bump 6.12 to 6.12.92 2026-06-02 21:15:21 +02:00
backport-6.18 kernel: bump 6.18 to 6.18.34 2026-06-02 21:14:04 +02:00
files ar8216: use devm for mdiobus consistently 2026-05-25 00:36:10 +02:00
files-6.12/drivers/net/phy/rtl8261n generic: 6.18: drop downstream RTL8261N driver 2026-05-21 17:04:55 +01:00
hack-6.12 kernel: bump 6.12 to 6.12.91 2026-05-25 21:02:13 +02:00
hack-6.18 kernel: fix WED offloaded flow timeout refresh 2026-06-04 22:42:02 +02:00
image treewide: strip trailing whitespace 2025-05-20 00:47:37 +02:00
other-files
pending-6.12 kernel: bump 6.12 to 6.12.92 2026-06-02 21:15:21 +02:00
pending-6.18 kernel: fix WED offloaded flow timeout refresh 2026-06-04 22:42:02 +02:00
config-6.12 generic: add DWMAC_QCOM_ETHQOS 2026-05-19 11:25:38 +02:00
config-6.18 generic: add missing config symbols for 6.18 2026-06-03 09:06:31 +02:00
config-filter generic: filter: add RUSTC symbols 2026-04-22 16:46:44 +02:00
kernel-6.12 kernel: bump 6.12 to 6.12.92 2026-06-02 21:15:21 +02:00
kernel-6.18 kernel: bump 6.18 to 6.18.34 2026-06-02 21:14:04 +02:00
PATCHES.md generic: improve patches documentation 2025-06-11 15:09:46 +02:00