Skip to content

Commit 17d7ce8

Browse files
nbd168frank-w
authored andcommitted
net: ethernet: mtk_eth_soc: use napi_build_skb()
The napi_build_skb() can reuse the skb in skb cache per CPU or can allocate skbs in bulk, which helps improve the performance. Signed-off-by: Felix Fietkau <nbd@nbd.name>
1 parent c719e7c commit 17d7ce8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/mediatek/mtk_eth_soc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2245,7 +2245,7 @@ static int mtk_poll_rx(struct napi_struct *napi, int budget,
22452245
if (ret != XDP_PASS)
22462246
goto skip_rx;
22472247

2248-
skb = build_skb(data, PAGE_SIZE);
2248+
skb = napi_build_skb(data, PAGE_SIZE);
22492249
if (unlikely(!skb)) {
22502250
page_pool_put_full_page(ring->page_pool,
22512251
page, true);
@@ -2283,7 +2283,7 @@ static int mtk_poll_rx(struct napi_struct *napi, int budget,
22832283
dma_unmap_single(eth->dma_dev, ((u64)trxd.rxd1 | addr64),
22842284
ring->buf_size, DMA_FROM_DEVICE);
22852285

2286-
skb = build_skb(data, ring->frag_size);
2286+
skb = napi_build_skb(data, ring->frag_size);
22872287
if (unlikely(!skb)) {
22882288
netdev->stats.rx_dropped++;
22892289
skb_free_frag(data);

0 commit comments

Comments
 (0)