Commit c14ff2ea2d5818c811e5c6e67e794df4a71a6094

Authored by Ben Hutchings
Committed by David S. Miller
1 parent 0f0d15100a

sfc: Delete EFX_PAGE_IP_ALIGN, equivalent to NET_IP_ALIGN

The two architectures that define CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
(powerpc and x86) now both define NET_IP_ALIGN as 0, so there is no
need for this optimisation any more.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 3 changed files with 6 additions and 19 deletions Side-by-side Diff

drivers/net/ethernet/sfc/efx.c
... ... @@ -638,13 +638,13 @@
638 638 EFX_MAX_FRAME_LEN(efx->net_dev->mtu) +
639 639 efx->type->rx_buffer_padding);
640 640 rx_buf_len = (sizeof(struct efx_rx_page_state) +
641   - EFX_PAGE_IP_ALIGN + efx->rx_dma_len);
  641 + NET_IP_ALIGN + efx->rx_dma_len);
642 642 if (rx_buf_len <= PAGE_SIZE) {
643 643 efx->rx_scatter = false;
644 644 efx->rx_buffer_order = 0;
645 645 } else if (efx->type->can_rx_scatter) {
646 646 BUILD_BUG_ON(sizeof(struct efx_rx_page_state) +
647   - EFX_PAGE_IP_ALIGN + EFX_RX_USR_BUF_SIZE >
  647 + NET_IP_ALIGN + EFX_RX_USR_BUF_SIZE >
648 648 PAGE_SIZE / 2);
649 649 efx->rx_scatter = true;
650 650 efx->rx_dma_len = EFX_RX_USR_BUF_SIZE;
drivers/net/ethernet/sfc/net_driver.h
... ... @@ -468,24 +468,11 @@
468 468 };
469 469  
470 470 /*
471   - * Alignment of page-allocated RX buffers
472   - *
473   - * Controls the number of bytes inserted at the start of an RX buffer.
474   - * This is the equivalent of NET_IP_ALIGN [which controls the alignment
475   - * of the skb->head for hardware DMA].
476   - */
477   -#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
478   -#define EFX_PAGE_IP_ALIGN 0
479   -#else
480   -#define EFX_PAGE_IP_ALIGN NET_IP_ALIGN
481   -#endif
482   -
483   -/*
484 471 * Alignment of the skb->head which wraps a page-allocated RX buffer
485 472 *
486 473 * The skb allocated to wrap an rx_buffer can have this alignment. Since
487 474 * the data is memcpy'd from the rx_buf, it does not need to be equal to
488   - * EFX_PAGE_IP_ALIGN.
  475 + * NET_IP_ALIGN.
489 476 */
490 477 #define EFX_PAGE_SKB_ALIGN 2
491 478  
drivers/net/ethernet/sfc/rx.c
... ... @@ -93,7 +93,7 @@
93 93  
94 94 void efx_rx_config_page_split(struct efx_nic *efx)
95 95 {
96   - efx->rx_page_buf_step = ALIGN(efx->rx_dma_len + EFX_PAGE_IP_ALIGN,
  96 + efx->rx_page_buf_step = ALIGN(efx->rx_dma_len + NET_IP_ALIGN,
97 97 L1_CACHE_BYTES);
98 98 efx->rx_bufs_per_page = efx->rx_buffer_order ? 1 :
99 99 ((PAGE_SIZE - sizeof(struct efx_rx_page_state)) /
100 100  
... ... @@ -188,9 +188,9 @@
188 188 do {
189 189 index = rx_queue->added_count & rx_queue->ptr_mask;
190 190 rx_buf = efx_rx_buffer(rx_queue, index);
191   - rx_buf->dma_addr = dma_addr + EFX_PAGE_IP_ALIGN;
  191 + rx_buf->dma_addr = dma_addr + NET_IP_ALIGN;
192 192 rx_buf->page = page;
193   - rx_buf->page_offset = page_offset + EFX_PAGE_IP_ALIGN;
  193 + rx_buf->page_offset = page_offset + NET_IP_ALIGN;
194 194 rx_buf->len = efx->rx_dma_len;
195 195 rx_buf->flags = 0;
196 196 ++rx_queue->added_count;