openwrt-pf/target/linux/generic/hack-6.18
Mieczyslaw Nalewaj 7b9483b992 mediatek: ethernet: fix offload with incompatible dsa tag
DSA copies the driver features to slave device, including offload
capabilities. Once a packet is sent through a DSA slave interface,
according to its features, the kernel does not calculate checksums,
expecting that the HW will fill the gaps. DSA adds the defined DSA
tag and sends the tagged packet through the master device.

Ethertype DSA tags expect the driver to calculate checksum based on the
csum_start/csum_offset. However, mtk_eth_soc does not use that info.
mtk_eth_soc checks the network header and decides if the HW can manage
that packet, unaware that MAC layer now contains an extra DSA tag. When
that tag is the Mediatek CPU tag, offload will work as expected.
When it is an incompatible DSA tag or if DSA is stacking two incompatible
DSA tags, the driver will still count on the HW offload. In this case,
packets are sent to the network with an incorrect checksum.

This patch adds an extra check that disables offloading only for the
RTL8367S switch's RTL8_4 tag, which is known to break MTK checksum
offload. The RTL8_4T (the trailing-tag variant) is not affected because
its rtl8_4t tagger already checksums the frame in software before appending
the tag, so ip_summed is no longer CHECKSUM_PARTIAL by the time this driver
sees it.

This approach avoids an overly conservative whitelist which would
disable offload for every non-Mediatek tag, regardless of whether
that tag is actually incompatible with MTK checksum offload.

Tags for other DSA-capable switches are left untouched by this fix
and are not claimed to be offload-safe.

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Signed-off-by: Schneider Azima <Schneider-Azima12@protonmail.com>
Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/23996
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-07-12 21:29:45 +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
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
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 treewide: use _scoped for loops 2026-06-20 10:03:00 +02:00
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.37 2026-06-28 22:29:48 +02:00
722-net-phy-aquantia-enable-AQR112-and-AQR412.patch
723-net-phy-aquantia-fix-system-side-protocol-mi.patch
725-net-phy-aquantia-add-PHY_IDs-for-AQR112-variants.patch
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
739-net-ethernet-mtk_eth_soc-fix-offload-with-incompatible-.patch mediatek: ethernet: fix offload with incompatible dsa tag 2026-07-12 21:29:45 +02:00
755-net-phy-motorcomm-yt8821-bus-collision-workaround.patch
760-net-usb-r8152-add-LED-configuration-from-OF.patch
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 kernel: bump 6.18 to 6.18.36 2026-06-23 09:05:22 +02:00
781-usb-net-rndis-support-asr.patch
800-GPIO-add-named-gpio-exports.patch treewide: use _scoped for loops 2026-06-20 10:03:00 +02:00
810-bcma-ssb-fallback-sprom.patch
820-ledtrig-network-module.patch leds: add "network" LED trigger (lan/wan/wlan) 2026-06-05 20:30:34 +02:00
890-serial-8250-add-UPIO_AU-case-to-set_io_from_upio.patch
901-debloat_sock_diag.patch kernel: bump 6.18 to 6.18.36 2026-06-23 09:05:22 +02:00
902-debloat_proc.patch kernel: bump 6.18 to 6.18.36 2026-06-23 09:05:22 +02:00
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 kernel: fix wrong strlcat call 2026-06-22 11:06:48 +02:00
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