sfc: commonise efx_sync_rx_buffer()
authorEdward Cree <ecree@solarflare.com>
Tue, 30 Jun 2020 12:11:52 +0000 (13:11 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 30 Jun 2020 20:09:09 +0000 (13:09 -0700)
The ef100 RX path will also need to DMA-sync RX buffers.

Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/sfc/rx.c
drivers/net/ethernet/sfc/rx_common.h

index c73b933a9101d418c625bfbf94ce282c57537322..59a43d586967fde0481645b02b56c18a62fd467d 100644 (file)
 #define EFX_RX_MAX_FRAGS DIV_ROUND_UP(EFX_MAX_FRAME_LEN(EFX_MAX_MTU), \
                                      EFX_RX_USR_BUF_SIZE)
 
-static inline void efx_sync_rx_buffer(struct efx_nic *efx,
-                                     struct efx_rx_buffer *rx_buf,
-                                     unsigned int len)
-{
-       dma_sync_single_for_cpu(&efx->pci_dev->dev, rx_buf->dma_addr, len,
-                               DMA_FROM_DEVICE);
-}
-
 static void efx_rx_packet__check_len(struct efx_rx_queue *rx_queue,
                                     struct efx_rx_buffer *rx_buf,
                                     int len)
index 1672d74f30e2ea20552a09d35d1e5bc3d610e676..207ccd8ba06219bc74b2c80a8807e9a84c2b1236 100644 (file)
@@ -57,6 +57,15 @@ void efx_init_rx_buffer(struct efx_rx_queue *rx_queue,
                        unsigned int page_offset,
                        u16 flags);
 void efx_unmap_rx_buffer(struct efx_nic *efx, struct efx_rx_buffer *rx_buf);
+
+static inline void efx_sync_rx_buffer(struct efx_nic *efx,
+                                     struct efx_rx_buffer *rx_buf,
+                                     unsigned int len)
+{
+       dma_sync_single_for_cpu(&efx->pci_dev->dev, rx_buf->dma_addr, len,
+                               DMA_FROM_DEVICE);
+}
+
 void efx_free_rx_buffers(struct efx_rx_queue *rx_queue,
                         struct efx_rx_buffer *rx_buf,
                         unsigned int num_bufs);