mbox series

[net-next,0/5] ionic: struct cleanups

Message ID 20200831233558.71417-1-snelson@pensando.io
Headers show
Series ionic: struct cleanups | expand

Message

Shannon Nelson Aug. 31, 2020, 11:35 p.m. UTC
This patchset has a few changes for better cacheline use,
to cleanup a page handling API, and to streamline the
Adminq/Notifyq queue handling.

Shannon Nelson (5):
  ionic: clean up page handling code
  ionic: smaller coalesce default
  ionic: struct reorder for faster access
  ionic: clean up desc_info and cq_info structs
  ionic: clean adminq service routine

 drivers/net/ethernet/pensando/ionic/ionic.h   |  3 -
 .../net/ethernet/pensando/ionic/ionic_dev.c   | 33 +-------
 .../net/ethernet/pensando/ionic/ionic_dev.h   | 26 +++---
 .../net/ethernet/pensando/ionic/ionic_lif.c   | 44 +++++-----
 .../net/ethernet/pensando/ionic/ionic_lif.h   | 14 ++--
 .../net/ethernet/pensando/ionic/ionic_main.c  | 26 ------
 .../net/ethernet/pensando/ionic/ionic_txrx.c  | 81 +++++++++++--------
 7 files changed, 92 insertions(+), 135 deletions(-)

Comments

David Miller Sept. 1, 2020, 12:14 a.m. UTC | #1
From: Shannon Nelson <snelson@pensando.io>
Date: Mon, 31 Aug 2020 16:35:54 -0700

> @@ -100,6 +100,8 @@ static struct sk_buff *ionic_rx_frags(struct ionic_queue *q,
>  		frag_len = min(len, (u16)PAGE_SIZE);
>  		len -= frag_len;
>  
> +		dma_sync_single_for_cpu(dev, dma_unmap_addr(page_info, dma_addr),
> +					len, DMA_FROM_DEVICE);
>  		dma_unmap_page(dev, dma_unmap_addr(page_info, dma_addr),
>  			       PAGE_SIZE, DMA_FROM_DEVICE);
>  		skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,

The unmap operation performs a sync, if necessary, for you.

That's the pattern of usage:

	map();
	device read/write memory
	unmap();

That's it, no more, no less.

The time to use sync is when you want to maintain the mapping and keep
using it.