Skip to content

Commit 3cd0a37

Browse files
developerfrank-w
developer
authored andcommitted
Fix software padding processing in Ethernet Tx path.
It's found that 20bytes(LLC), 28bytes, and 36bytes(PPP LCP Configuration Ack) packets with additional 4bytes special tag for dsa driver would lead to switch Tx CRC error, followed by switch output queue stuck issue. Therefore, Ethernet driver check skb->len <= 40(36bytes PPP LCP + 4bytes special tag) and conduct software padding. Moreover, skb linearization should be checked again after conduct software padding. If without this patch, users might encounter problems when establishing a PPPoE tunnel. Change-Id: Id28fa3870dc9e905207d95634fe5cd692f363761 Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/9129634 frank-w: changed condition to MTK_MIN_TX_LENGTH
1 parent 5584651 commit 3cd0a37

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/ethernet/mediatek/mtk_eth_soc.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -1565,10 +1565,11 @@ static int mtk_tx_map(struct sk_buff *skb, struct net_device *dev,
15651565
int queue = skb_get_queue_mapping(skb);
15661566
int k = 0;
15671567

1568-
if (skb->len < 32) {
1568+
if (skb->len <= MTK_MIN_TX_LENGTH) {
15691569
if (skb_put_padto(skb, MTK_MIN_TX_LENGTH))
15701570
return -ENOMEM;
15711571

1572+
txd_info.last = !skb_is_nonlinear(skb);
15721573
txd_info.size = skb_headlen(skb);
15731574
}
15741575

0 commit comments

Comments
 (0)