Skip to content

Commit

Permalink
ionic: use dma range APIs
Browse files Browse the repository at this point in the history
Convert Rx datapath handling to use the DMA range APIs
in preparation for adding XDP handling.

Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
Reviewed-by: Brett Creeley <brett.creeley@amd.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Shannon Nelson authored and David S. Miller committed Feb 16, 2024
1 parent 97538c1 commit d67ee21
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions drivers/net/ethernet/pensando/ionic/ionic_txrx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit d67ee21

Please sign in to comment.