From 86c81686c94da649334103f8509d15ec23a77fbb Mon Sep 17 00:00:00 2001 From: Lukasz M Date: Thu, 26 Sep 2024 16:22:05 +0200 Subject: [PATCH] Add padding for small tx packets --- ...add-software-padding-ethernet-tx-path.patch | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 target/linux/generic/pending-5.15/739-add-software-padding-ethernet-tx-path.patch diff --git a/target/linux/generic/pending-5.15/739-add-software-padding-ethernet-tx-path.patch b/target/linux/generic/pending-5.15/739-add-software-padding-ethernet-tx-path.patch new file mode 100644 index 00000000000000..dca78d6003c710 --- /dev/null +++ b/target/linux/generic/pending-5.15/739-add-software-padding-ethernet-tx-path.patch @@ -0,0 +1,18 @@ +diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +index 31968b8..d93d7fa 100644 +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c ++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +@@ -1523,6 +1523,13 @@ 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 <= 40) { ++ if (skb_put_padto(skb, 60)) ++ return -ENOMEM; ++ txd_info.size = skb_headlen(skb); ++ txd_info.last = !skb_is_nonlinear(skb); ++ } ++ + txq = netdev_get_tx_queue(dev, queue); + itxd = ring->next_free; + itxd_pdma = qdma_to_pdma(ring, itxd);