[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240208005725.65134-5-shannon.nelson@amd.com>
Date: Wed, 7 Feb 2024 16:57:19 -0800
From: Shannon Nelson <shannon.nelson@....com>
To: <netdev@...r.kernel.org>, <davem@...emloft.net>, <kuba@...nel.org>,
<edumazet@...gle.com>, <pabeni@...hat.com>
CC: <brett.creeley@....com>, <drivers@...sando.io>, Shannon Nelson
<shannon.nelson@....com>
Subject: [PATCH v2 net-next 04/10] ionic: use dma range APIs
Convert Rx datapath handling to use the DMA range APIs
in preparation for adding XDP handling.
Signed-off-by: Shannon Nelson <shannon.nelson@....com>
Reviewed-by: Brett Creeley <brett.creeley@....com>
---
drivers/net/ethernet/pensando/ionic/ionic_txrx.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c
index 8659f5a50a6e..65d6fdff3767 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c
@@ -225,9 +225,8 @@ static struct sk_buff *ionic_rx_frags(struct ionic_queue *q,
frag_len = min_t(u16, len, ionic_rx_buf_size(buf_info));
len -= frag_len;
- dma_sync_single_for_cpu(dev,
- ionic_rx_buf_pa(buf_info),
- frag_len, DMA_FROM_DEVICE);
+ dma_sync_single_range_for_cpu(dev, ionic_rx_buf_pa(buf_info),
+ 0, frag_len, DMA_FROM_DEVICE);
skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
buf_info->page, buf_info->page_offset, frag_len,
@@ -276,11 +275,11 @@ static struct sk_buff *ionic_rx_copybreak(struct ionic_queue *q,
return NULL;
}
- dma_sync_single_for_cpu(dev, ionic_rx_buf_pa(buf_info),
- len, DMA_FROM_DEVICE);
+ dma_sync_single_range_for_cpu(dev, ionic_rx_buf_pa(buf_info),
+ 0, len, DMA_FROM_DEVICE);
skb_copy_to_linear_data(skb, ionic_rx_buf_va(buf_info), len);
- dma_sync_single_for_device(dev, ionic_rx_buf_pa(buf_info),
- len, DMA_FROM_DEVICE);
+ dma_sync_single_range_for_device(dev, ionic_rx_buf_pa(buf_info),
+ 0, len, DMA_FROM_DEVICE);
skb_put(skb, len);
skb->protocol = eth_type_trans(skb, q->lif->netdev);
--
2.17.1
Powered by blists - more mailing lists