summaryrefslogtreecommitdiff
path: root/target/linux/ramips/files-4.9
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2017-12-05 16:40:42 +0100
committerFelix Fietkau <nbd@nbd.name>2018-02-05 10:16:26 +0100
commitd3ea5fc9f33e0951e36a6443a803b916a94d3b4f (patch)
tree434e9bef12ef8e35ad2686fdc0bc3bad97100e3c /target/linux/ramips/files-4.9
parent968b8616127a52fe5baff20a1f29ff49ade26bc2 (diff)
downloadmtk-20170518-d3ea5fc9f33e0951e36a6443a803b916a94d3b4f.zip
mtk-20170518-d3ea5fc9f33e0951e36a6443a803b916a94d3b4f.tar.gz
mtk-20170518-d3ea5fc9f33e0951e36a6443a803b916a94d3b4f.tar.bz2
ramips: use napi_alloc_frag and skb_free_frag
Slightly improves rx performance Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'target/linux/ramips/files-4.9')
-rw-r--r--target/linux/ramips/files-4.9/drivers/net/ethernet/mtk/mtk_eth_soc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/target/linux/ramips/files-4.9/drivers/net/ethernet/mtk/mtk_eth_soc.c b/target/linux/ramips/files-4.9/drivers/net/ethernet/mtk/mtk_eth_soc.c
index f2c1109..79ec17e 100644
--- a/target/linux/ramips/files-4.9/drivers/net/ethernet/mtk/mtk_eth_soc.c
+++ b/target/linux/ramips/files-4.9/drivers/net/ethernet/mtk/mtk_eth_soc.c
@@ -216,7 +216,7 @@ static void fe_clean_rx(struct fe_priv *priv)
ring->rx_dma[i].rxd1,
ring->rx_buf_size,
DMA_FROM_DEVICE);
- put_page(virt_to_head_page(ring->rx_data[i]));
+ skb_free_frag(ring->rx_data[i]);
}
kfree(ring->rx_data);
@@ -834,7 +834,7 @@ static int fe_poll_rx(struct napi_struct *napi, int budget,
break;
/* alloc new buffer */
- new_data = netdev_alloc_frag(ring->frag_size);
+ new_data = napi_alloc_frag(ring->frag_size);
if (unlikely(!new_data)) {
stats->rx_dropped++;
goto release_desc;
@@ -844,14 +844,14 @@ static int fe_poll_rx(struct napi_struct *napi, int budget,
ring->rx_buf_size,
DMA_FROM_DEVICE);
if (unlikely(dma_mapping_error(&netdev->dev, dma_addr))) {
- put_page(virt_to_head_page(new_data));
+ skb_free_frag(new_data);
goto release_desc;
}
/* receive data */
skb = build_skb(data, ring->frag_size);
if (unlikely(!skb)) {
- put_page(virt_to_head_page(new_data));
+ skb_free_frag(new_data);
goto release_desc;
}
skb_reserve(skb, NET_SKB_PAD + NET_IP_ALIGN);