sfc: commonise efx_sync_rx_buffer()
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>
This commit is contained in:
committed by
David S. Miller
parent
f7e55550a3
commit
80a0074e6a
@@ -40,14 +40,6 @@
|
|||||||
#define EFX_RX_MAX_FRAGS DIV_ROUND_UP(EFX_MAX_FRAME_LEN(EFX_MAX_MTU), \
|
#define EFX_RX_MAX_FRAGS DIV_ROUND_UP(EFX_MAX_FRAME_LEN(EFX_MAX_MTU), \
|
||||||
EFX_RX_USR_BUF_SIZE)
|
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,
|
static void efx_rx_packet__check_len(struct efx_rx_queue *rx_queue,
|
||||||
struct efx_rx_buffer *rx_buf,
|
struct efx_rx_buffer *rx_buf,
|
||||||
int len)
|
int len)
|
||||||
|
|||||||
@@ -57,6 +57,15 @@ void efx_init_rx_buffer(struct efx_rx_queue *rx_queue,
|
|||||||
unsigned int page_offset,
|
unsigned int page_offset,
|
||||||
u16 flags);
|
u16 flags);
|
||||||
void efx_unmap_rx_buffer(struct efx_nic *efx, struct efx_rx_buffer *rx_buf);
|
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,
|
void efx_free_rx_buffers(struct efx_rx_queue *rx_queue,
|
||||||
struct efx_rx_buffer *rx_buf,
|
struct efx_rx_buffer *rx_buf,
|
||||||
unsigned int num_bufs);
|
unsigned int num_bufs);
|
||||||
|
|||||||
Reference in New Issue
Block a user