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.h35
1 files changed, 28 insertions, 7 deletions
diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h
index 1bc911f980b5..e41b54bada7c 100644
--- a/drivers/net/ethernet/sfc/net_driver.h
+++ b/drivers/net/ethernet/sfc/net_driver.h
@@ -69,6 +69,12 @@
69#define EFX_TXQ_TYPES 4 69#define EFX_TXQ_TYPES 4
70#define EFX_MAX_TX_QUEUES (EFX_TXQ_TYPES * EFX_MAX_CHANNELS) 70#define EFX_MAX_TX_QUEUES (EFX_TXQ_TYPES * EFX_MAX_CHANNELS)
71 71
72/* Maximum possible MTU the driver supports */
73#define EFX_MAX_MTU (9 * 1024)
74
75/* Size of an RX scatter buffer. Small enough to pack 2 into a 4K page. */
76#define EFX_RX_USR_BUF_SIZE 1824
77
72/* Forward declare Precision Time Protocol (PTP) support structure. */ 78/* Forward declare Precision Time Protocol (PTP) support structure. */
73struct efx_ptp_data; 79struct efx_ptp_data;
74 80
@@ -212,7 +218,8 @@ struct efx_tx_queue {
212 * If completed: offset in @page of Ethernet header. 218 * If completed: offset in @page of Ethernet header.
213 * @len: If pending: length for DMA descriptor. 219 * @len: If pending: length for DMA descriptor.
214 * If completed: received length, excluding hash prefix. 220 * If completed: received length, excluding hash prefix.
215 * @flags: Flags for buffer and packet state. 221 * @flags: Flags for buffer and packet state. These are only set on the
222 * first buffer of a scattered packet.
216 */ 223 */
217struct efx_rx_buffer { 224struct efx_rx_buffer {
218 dma_addr_t dma_addr; 225 dma_addr_t dma_addr;
@@ -256,6 +263,7 @@ struct efx_rx_page_state {
256 * @added_count: Number of buffers added to the receive queue. 263 * @added_count: Number of buffers added to the receive queue.
257 * @notified_count: Number of buffers given to NIC (<= @added_count). 264 * @notified_count: Number of buffers given to NIC (<= @added_count).
258 * @removed_count: Number of buffers removed from the receive queue. 265 * @removed_count: Number of buffers removed from the receive queue.
266 * @scatter_n: Number of buffers used by current packet
259 * @max_fill: RX descriptor maximum fill level (<= ring size) 267 * @max_fill: RX descriptor maximum fill level (<= ring size)
260 * @fast_fill_trigger: RX descriptor fill level that will trigger a fast fill 268 * @fast_fill_trigger: RX descriptor fill level that will trigger a fast fill
261 * (<= @max_fill) 269 * (<= @max_fill)
@@ -276,6 +284,7 @@ struct efx_rx_queue {
276 unsigned int added_count; 284 unsigned int added_count;
277 unsigned int notified_count; 285 unsigned int notified_count;
278 unsigned int removed_count; 286 unsigned int removed_count;
287 unsigned int scatter_n;
279 unsigned int max_fill; 288 unsigned int max_fill;
280 unsigned int fast_fill_trigger; 289 unsigned int fast_fill_trigger;
281 unsigned int min_fill; 290 unsigned int min_fill;
@@ -335,6 +344,12 @@ enum efx_rx_alloc_method {
335 * @n_rx_frm_trunc: Count of RX_FRM_TRUNC errors 344 * @n_rx_frm_trunc: Count of RX_FRM_TRUNC errors
336 * @n_rx_overlength: Count of RX_OVERLENGTH errors 345 * @n_rx_overlength: Count of RX_OVERLENGTH errors
337 * @n_skbuff_leaks: Count of skbuffs leaked due to RX overrun 346 * @n_skbuff_leaks: Count of skbuffs leaked due to RX overrun
347 * @n_rx_nodesc_trunc: Number of RX packets truncated and then dropped due to
348 * lack of descriptors
349 * @rx_pkt_n_frags: Number of fragments in next packet to be delivered by
350 * __efx_rx_packet(), or zero if there is none
351 * @rx_pkt_index: Ring index of first buffer for next packet to be delivered
352 * by __efx_rx_packet(), if @rx_pkt_n_frags != 0
338 * @rx_queue: RX queue for this channel 353 * @rx_queue: RX queue for this channel
339 * @tx_queue: TX queues for this channel 354 * @tx_queue: TX queues for this channel
340 */ 355 */
@@ -366,11 +381,10 @@ struct efx_channel {
366 unsigned n_rx_frm_trunc; 381 unsigned n_rx_frm_trunc;
367 unsigned n_rx_overlength; 382 unsigned n_rx_overlength;
368 unsigned n_skbuff_leaks; 383 unsigned n_skbuff_leaks;
384 unsigned int n_rx_nodesc_trunc;
369 385
370 /* Used to pipeline received packets in order to optimise memory 386 unsigned int rx_pkt_n_frags;
371 * access with prefetches. 387 unsigned int rx_pkt_index;
372 */
373 struct efx_rx_buffer *rx_pkt;
374 388
375 struct efx_rx_queue rx_queue; 389 struct efx_rx_queue rx_queue;
376 struct efx_tx_queue tx_queue[EFX_TXQ_TYPES]; 390 struct efx_tx_queue tx_queue[EFX_TXQ_TYPES];
@@ -672,8 +686,11 @@ struct vfdi_status;
672 * @n_tx_channels: Number of channels used for TX 686 * @n_tx_channels: Number of channels used for TX
673 * @rx_dma_len: Current maximum RX DMA length 687 * @rx_dma_len: Current maximum RX DMA length
674 * @rx_buffer_order: Order (log2) of number of pages for each RX buffer 688 * @rx_buffer_order: Order (log2) of number of pages for each RX buffer
689 * @rx_buffer_truesize: Amortised allocation size of an RX buffer,
690 * for use in sk_buff::truesize
675 * @rx_hash_key: Toeplitz hash key for RSS 691 * @rx_hash_key: Toeplitz hash key for RSS
676 * @rx_indir_table: Indirection table for RSS 692 * @rx_indir_table: Indirection table for RSS
693 * @rx_scatter: Scatter mode enabled for receives
677 * @int_error_count: Number of internal errors seen recently 694 * @int_error_count: Number of internal errors seen recently
678 * @int_error_expire: Time at which error count will be expired 695 * @int_error_expire: Time at which error count will be expired
679 * @irq_status: Interrupt status buffer 696 * @irq_status: Interrupt status buffer
@@ -788,8 +805,10 @@ struct efx_nic {
788 unsigned n_tx_channels; 805 unsigned n_tx_channels;
789 unsigned int rx_dma_len; 806 unsigned int rx_dma_len;
790 unsigned int rx_buffer_order; 807 unsigned int rx_buffer_order;
808 unsigned int rx_buffer_truesize;
791 u8 rx_hash_key[40]; 809 u8 rx_hash_key[40];
792 u32 rx_indir_table[128]; 810 u32 rx_indir_table[128];
811 bool rx_scatter;
793 812
794 unsigned int_error_count; 813 unsigned int_error_count;
795 unsigned long int_error_expire; 814 unsigned long int_error_expire;
@@ -920,8 +939,9 @@ static inline unsigned int efx_port_num(struct efx_nic *efx)
920 * @evq_ptr_tbl_base: Event queue pointer table base address 939 * @evq_ptr_tbl_base: Event queue pointer table base address
921 * @evq_rptr_tbl_base: Event queue read-pointer table base address 940 * @evq_rptr_tbl_base: Event queue read-pointer table base address
922 * @max_dma_mask: Maximum possible DMA mask 941 * @max_dma_mask: Maximum possible DMA mask
923 * @rx_buffer_hash_size: Size of hash at start of RX buffer 942 * @rx_buffer_hash_size: Size of hash at start of RX packet
924 * @rx_buffer_padding: Size of padding at end of RX buffer 943 * @rx_buffer_padding: Size of padding at end of RX packet
944 * @can_rx_scatter: NIC is able to scatter packet to multiple buffers
925 * @max_interrupt_mode: Highest capability interrupt mode supported 945 * @max_interrupt_mode: Highest capability interrupt mode supported
926 * from &enum efx_init_mode. 946 * from &enum efx_init_mode.
927 * @phys_addr_channels: Number of channels with physically addressed 947 * @phys_addr_channels: Number of channels with physically addressed
@@ -969,6 +989,7 @@ struct efx_nic_type {
969 u64 max_dma_mask; 989 u64 max_dma_mask;
970 unsigned int rx_buffer_hash_size; 990 unsigned int rx_buffer_hash_size;
971 unsigned int rx_buffer_padding; 991 unsigned int rx_buffer_padding;
992 bool can_rx_scatter;
972 unsigned int max_interrupt_mode; 993 unsigned int max_interrupt_mode;
973 unsigned int phys_addr_channels; 994 unsigned int phys_addr_channels;
974 unsigned int timer_period_max; 995 unsigned int timer_period_max;