Skip to content

Commit

Permalink
Add padding for small tx packets
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukasz M committed Sep 26, 2024
1 parent dfb1638 commit 86c8168
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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);

0 comments on commit 86c8168

Please sign in to comment.