Skip to content

Commit 047a79a

Browse files
nbd168gregkh
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 <[email protected]> Signed-off-by: Felix Fietkau <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 3d2b356 commit 047a79a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

drivers/net/ethernet/mediatek/mtk_eth_soc.c

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

1740+
if (skb_vlan_tag_present(skb) &&
1741+
!eth_proto_is_802_3(eth_hdr(skb)->h_proto)) {
1742+
skb = __vlan_hwaccel_push_inside(skb);
1743+
if (!skb)
1744+
goto dropped;
1745+
}
1746+
17401747
/* normally we can rely on the stack not calling this more than once,
17411748
* however we have 2 queues running on the same ring so we need to lock
17421749
* the ring access
@@ -1782,8 +1789,9 @@ static netdev_tx_t mtk_start_xmit(struct sk_buff *skb, struct net_device *dev)
17821789

17831790
drop:
17841791
spin_unlock(&eth->page_lock);
1785-
stats->tx_dropped++;
17861792
dev_kfree_skb_any(skb);
1793+
dropped:
1794+
stats->tx_dropped++;
17871795
return NETDEV_TX_OK;
17881796
}
17891797

0 commit comments

Comments
 (0)