openwrt-pf/target/linux/generic/hack-6.18
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
..
200-tools_portability.patch
201-gen_init_cpio_portability.patch kernel: fix gen_init_cpio build on macOS hosts 2026-06-04 20:00:36 +02:00
202-objtool_portability.patch kernel: fix objtool build on macOS hosts 2026-06-04 20:00:36 +02:00
204-module_strip.patch kernel: bump 6.18 to 6.18.21 2026-04-03 19:10:05 +02:00
205-kconfig-abort-configuration-on-unset-symbol.patch
210-darwin_scripts_include.patch
211-darwin-uuid-typedef-clash.patch
214-spidev_h_portability.patch
230-openwrt_lzma_options.patch
249-udp-tunnel-selection.patch
250-netfilter_depends.patch
251-kconfig.patch
253-ksmbd-config.patch
259-regmap_dynamic.patch kernel: bump 6.18 to 6.18.21 2026-04-03 19:10:05 +02:00
260-crypto_test_dependencies.patch
261-lib-arc4-unhide.patch
280-rfkill-stubs.patch
300-MIPS-r4k_cache-use-more-efficient-cache-blast.patch
301-01-mm-permit-to-declare-custom-execmem-alloc-free-funct.patch
301-02-mips-replace-mlong-calls-with-mno-long-calls-if-poss.patch
402-mtd-blktrans-call-add-disks-after-mtd-device.patch
420-mtd-support-OpenWrt-s-MTD_ROOTFS_ROOT_DEV.patch
421-drivers-mtd-parsers-add-nvmem-support-to-cmdlinepart.patch
430-mtk-bmt-support.patch
499-LEGACY-block-partitions-populate-fwnode.patch kernel: bump 6.18 to 6.18.27 2026-05-09 11:02:51 +02:00
600-net-enable-fraglist-GRO-by-default.patch
610-net-page_pool-try-to-free-deferred-skbs-while-waitin.patch
645-netfilter-connmark-introduce-set-dscpmark.patch
650-netfilter-add-xt_FLOWOFFLOAD-target.patch kernel: fix WED offloaded flow timeout refresh 2026-06-04 22:42:02 +02:00
651-wireless_mesh_header.patch
660-fq_codel_defaults.patch
661-kernel-ct-size-the-hashtable-more-adequately.patch
700-swconfig_switch_drivers.patch
710-net-sched-sch_cake-configure-sync_time-via-debugfs.patch kernel: bump 6.18 to 6.18.33 2026-05-25 21:04:53 +02:00
711-net-dsa-mv88e6xxx-disable-ATU-violation.patch
721-net-add-packet-mangeling.patch kernel: bump 6.18 to 6.18.22 2026-04-30 01:14:12 +02:00
722-net-phy-aquantia-enable-AQR112-and-AQR412.patch generic: 6.18: add and fix support for Aquantia PHYs 2026-04-27 02:56:15 +01:00
723-net-phy-aquantia-fix-system-side-protocol-mi.patch generic: 6.18: add and fix support for Aquantia PHYs 2026-04-27 02:56:15 +01:00
725-net-phy-aquantia-add-PHY_IDs-for-AQR112-variants.patch generic: 6.18: add and fix support for Aquantia PHYs 2026-04-27 02:56:15 +01:00
730-net-ethernet-mtk_eth_soc-add-hw-dump-for-forced-rese.patch kernel: bump 6.18 to 6.18.25 2026-04-30 01:15:19 +02:00
755-net-phy-motorcomm-yt8821-bus-collision-workaround.patch kernel: backport Motorcomm YT6801 PCIe ethernet driver support 2026-04-23 00:52:00 +02:00
760-net-usb-r8152-add-LED-configuration-from-OF.patch kernel: backport RTL8157 support to 6.18 2026-04-26 09:57:50 +02:00
761-dt-bindings-net-add-RTL8152-binding-documentation.patch
766-net-phy-mediatek-ge-add-LED-configuration-interface.patch
770-r8169-LED-uses-original-network-port-name.patch
773-bgmac-add-srab-switch.patch
780-usb-net-MeigLink_modem_support.patch
781-usb-net-rndis-support-asr.patch
800-GPIO-add-named-gpio-exports.patch kernel: bump 6.18 to 6.18.30 2026-05-16 21:28:04 +02:00
810-bcma-ssb-fallback-sprom.patch
890-serial-8250-add-UPIO_AU-case-to-set_io_from_upio.patch
901-debloat_sock_diag.patch
902-debloat_proc.patch
904-debloat_dma_buf.patch
905-io_uring-zcrx-Use-IS_REACHABLE-instead-of-IS_ENABLED.patch
910-kobject_uevent.patch
911-kobject_add_broadcast_uevent.patch
920-device_tree_cmdline.patch
926-crypto-eip93-use-AES-fallback-for-small-requests.patch
930-Revert-Revert-Revert-driver-core-Set-fw_devlink-on-b.patch
940-kbuild-extract-modules-builtin-modinfo-from-vmlinux_o.patch
950-silence-unused-variable-warnings.patch kernel: bump 6.18 to 6.18.33 2026-05-25 21:04:53 +02:00