Skip to content

Commit 312414a

Browse files
nbd168opsiff
authored andcommitted
net: ethernet: mtk_eth_soc: fix tx vlan tag for llc packets
[ Upstream commit d473673 ] 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: 656e705 ("net-next: mediatek: add support for MT7623 ethernet") Reported-by: Thibaut VARENE <hacks@slashdirt.org> Signed-off-by: Felix Fietkau <nbd@nbd.name> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20250831182007.51619-1-nbd@nbd.name Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org> (cherry picked from commit 61b80fbdc0726317f72f9074e10126e0eb0e49c5)
1 parent 0076543 commit 312414a

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

drivers/net/ethernet/mediatek/mtk_eth_soc.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1586,6 +1586,13 @@ static netdev_tx_t mtk_start_xmit(struct sk_buff *skb, struct net_device *dev)
15861586
bool gso = false;
15871587
int tx_num;
15881588

1589+
if (skb_vlan_tag_present(skb) &&
1590+
!eth_proto_is_802_3(eth_hdr(skb)->h_proto)) {
1591+
skb = __vlan_hwaccel_push_inside(skb);
1592+
if (!skb)
1593+
goto dropped;
1594+
}
1595+
15891596
/* normally we can rely on the stack not calling this more than once,
15901597
* however we have 2 queues running on the same ring so we need to lock
15911598
* the ring access
@@ -1631,8 +1638,9 @@ static netdev_tx_t mtk_start_xmit(struct sk_buff *skb, struct net_device *dev)
16311638

16321639
drop:
16331640
spin_unlock(&eth->page_lock);
1634-
stats->tx_dropped++;
16351641
dev_kfree_skb_any(skb);
1642+
dropped:
1643+
stats->tx_dropped++;
16361644
return NETDEV_TX_OK;
16371645
}
16381646

0 commit comments

Comments
 (0)