Skip to content

Commit

Permalink
Fix software padding processing in Ethernet Tx path.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
developer authored and frank-w committed Jan 8, 2025
1 parent 5584651 commit 3cd0a37
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/ethernet/mediatek/mtk_eth_soc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1565,10 +1565,11 @@ static int mtk_tx_map(struct sk_buff *skb, struct net_device *dev,
int queue = skb_get_queue_mapping(skb);
int k = 0;

if (skb->len < 32) {
if (skb->len <= MTK_MIN_TX_LENGTH) {
if (skb_put_padto(skb, MTK_MIN_TX_LENGTH))
return -ENOMEM;

txd_info.last = !skb_is_nonlinear(skb);
txd_info.size = skb_headlen(skb);
}

Expand Down

0 comments on commit 3cd0a37

Please sign in to comment.