aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/sfc/net_driver.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/sfc/net_driver.h')
-rw-r--r--drivers/net/ethernet/sfc/net_driver.h31
1 files changed, 15 insertions, 16 deletions
diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h
index 9bd433a095c5..39d6bd77f015 100644
--- a/drivers/net/ethernet/sfc/net_driver.h
+++ b/drivers/net/ethernet/sfc/net_driver.h
@@ -72,8 +72,20 @@
72/* Maximum possible MTU the driver supports */ 72/* Maximum possible MTU the driver supports */
73#define EFX_MAX_MTU (9 * 1024) 73#define EFX_MAX_MTU (9 * 1024)
74 74
75/* Size of an RX scatter buffer. Small enough to pack 2 into a 4K page. */ 75/* Size of an RX scatter buffer. Small enough to pack 2 into a 4K page,
76#define EFX_RX_USR_BUF_SIZE 1824 76 * and should be a multiple of the cache line size.
77 */
78#define EFX_RX_USR_BUF_SIZE (2048 - 256)
79
80/* If possible, we should ensure cache line alignment at start and end
81 * of every buffer. Otherwise, we just need to ensure 4-byte
82 * alignment of the network header.
83 */
84#if NET_IP_ALIGN == 0
85#define EFX_RX_BUF_ALIGNMENT L1_CACHE_BYTES
86#else
87#define EFX_RX_BUF_ALIGNMENT 4
88#endif
77 89
78/* Forward declare Precision Time Protocol (PTP) support structure. */ 90/* Forward declare Precision Time Protocol (PTP) support structure. */
79struct efx_ptp_data; 91struct efx_ptp_data;
@@ -468,24 +480,11 @@ enum nic_state {
468}; 480};
469 481
470/* 482/*
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 * Alignment of the skb->head which wraps a page-allocated RX buffer 483 * Alignment of the skb->head which wraps a page-allocated RX buffer
485 * 484 *
486 * The skb allocated to wrap an rx_buffer can have this alignment. Since 485 * The skb allocated to wrap an rx_buffer can have this alignment. Since
487 * the data is memcpy'd from the rx_buf, it does not need to be equal to 486 * the data is memcpy'd from the rx_buf, it does not need to be equal to
488 * EFX_PAGE_IP_ALIGN. 487 * NET_IP_ALIGN.
489 */ 488 */
490#define EFX_PAGE_SKB_ALIGN 2 489#define EFX_PAGE_SKB_ALIGN 2
491 490