[openwrt/openwrt] kernel: mtk_eth_soc: fix tx vlan tag for llc packets

LEDE Commits lede-commits at lists.infradead.org
Sun Aug 31 11:40:04 PDT 2025


nbd pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/9de2da13bf5ee895e8acf5a83f910bbdef46f0d1

commit 9de2da13bf5ee895e8acf5a83f910bbdef46f0d1
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Sun Aug 31 20:28:52 2025 +0200

    kernel: mtk_eth_soc: fix tx vlan tag for llc packets
    
    When sending llc packets with vlan tx offload, the hardware fails to
    actually add the tag. Deal with this by fixing it up in software.
    
    Fixes: https://github.com/openwrt/openwrt/issues/19916
    Reported-by: Thibaut VARENE <hacks at slashdirt.org>
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
    (cherry picked from commit f7d40365558f3426b85be35f1f2ba7d01df96dd0)
---
 ...t-mtk_eth_soc-fix-tx-vlan-tag-for-llc-pac.patch | 39 ++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/target/linux/generic/pending-6.6/742-net-ethernet-mtk_eth_soc-fix-tx-vlan-tag-for-llc-pac.patch b/target/linux/generic/pending-6.6/742-net-ethernet-mtk_eth_soc-fix-tx-vlan-tag-for-llc-pac.patch
new file mode 100644
index 0000000000..4876d858fd
--- /dev/null
+++ b/target/linux/generic/pending-6.6/742-net-ethernet-mtk_eth_soc-fix-tx-vlan-tag-for-llc-pac.patch
@@ -0,0 +1,39 @@
+From: Felix Fietkau <nbd at nbd.name>
+Date: Sun, 31 Aug 2025 20:05:13 +0200
+Subject: [PATCH] net: ethernet: mtk_eth_soc: fix tx vlan tag for llc packets
+
+When sending llc packets with vlan tx offload, the hardware fails to
+actually add the tag. Deal with this by fixing it up in software.
+
+Fixes: 656e705243fd ("net-next: mediatek: add support for MT7623 ethernet")
+Reported-by: Thibaut VARENE <hacks at slashdirt.org>
+Signed-off-by: Felix Fietkau <nbd at nbd.name>
+---
+
+--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+@@ -1763,6 +1763,13 @@ static netdev_tx_t mtk_start_xmit(struct
+ 	bool gso = false;
+ 	int tx_num;
+ 
++	if (skb_vlan_tag_present(skb) &&
++	    !eth_proto_is_802_3(eth_hdr(skb)->h_proto)) {
++		skb = __vlan_hwaccel_push_inside(skb);
++		if (!skb)
++			goto dropped;
++	}
++
+ 	/* normally we can rely on the stack not calling this more than once,
+ 	 * however we have 2 queues running on the same ring so we need to lock
+ 	 * the ring access
+@@ -1826,8 +1833,9 @@ static netdev_tx_t mtk_start_xmit(struct
+ 
+ drop:
+ 	spin_unlock(&eth->page_lock);
+-	stats->tx_dropped++;
+ 	dev_kfree_skb_any(skb);
++dropped:
++	stats->tx_dropped++;
+ 	return NETDEV_TX_OK;
+ }
+ 




More information about the lede-commits mailing list