Skip to content

Commit d473673

Browse files
nbd168kuba-moo
authored andcommitted
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: 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]>
1 parent c06ca8c commit d473673

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
@@ -1761,6 +1761,13 @@ static netdev_tx_t mtk_start_xmit(struct sk_buff *skb, struct net_device *dev)
17611761
bool gso = false;
17621762
int tx_num;
17631763

1764+
if (skb_vlan_tag_present(skb) &&
1765+
!eth_proto_is_802_3(eth_hdr(skb)->h_proto)) {
1766+
skb = __vlan_hwaccel_push_inside(skb);
1767+
if (!skb)
1768+
goto dropped;
1769+
}
1770+
17641771
/* normally we can rely on the stack not calling this more than once,
17651772
* however we have 2 queues running on the same ring so we need to lock
17661773
* the ring access
@@ -1806,8 +1813,9 @@ static netdev_tx_t mtk_start_xmit(struct sk_buff *skb, struct net_device *dev)
18061813

18071814
drop:
18081815
spin_unlock(&eth->page_lock);
1809-
stats->tx_dropped++;
18101816
dev_kfree_skb_any(skb);
1817+
dropped:
1818+
stats->tx_dropped++;
18111819
return NETDEV_TX_OK;
18121820
}
18131821

0 commit comments

Comments
 (0)