Lines Matching +full:queue +full:- +full:rx

1 /* SPDX-License-Identifier: GPL-2.0-only */
4 * Copyright 2005-2006 Fen Systems Ltd.
5 * Copyright 2005-2013 Solarflare Communications Inc.
63 /* Checksum generation is a per-queue option in hardware, so each
64 * queue visible to the networking core is backed by two hardware TX
79 /* Size of an RX scatter buffer. Small enough to pack 2 into a 4K page,
82 #define EF4_RX_USR_BUF_SIZE (2048 - 256)
85 * of every buffer. Otherwise, we just need to ensure 4-byte
97 * struct ef4_buffer - A general-purpose DMA buffer
112 * struct ef4_special_buffer - DMA buffer entered into buffer table
119 * table entries (and so can be physically non-contiguous, although we
132 * struct ef4_tx_buffer - buffer state for a TX descriptor
135 * @option: When @flags & %EF4_TX_BUF_OPTION, a NIC-specific option descriptor.
139 * This field is zero when the queue slot is empty.
161 * struct ef4_tx_queue - An Efx TX queue
174 * @queue: DMA queue number
176 * @core_txq: The networking core TX queue structure
179 * %EF4_TX_CB_ORDER into %EF4_TX_CB_SIZE-sized chunks.
182 * @initialised: Has hardware queue been initialised?
183 * @tx_min_size: Minimum transmit size for this queue. Depends on HW.
188 * only get the up-to-date value of @write_count if this
189 * variable indicates that the queue is empty. This is to
190 * avoid cache-line ping-pong between the xmit path and the
201 * only get the up-to-date value of read_count if this
202 * variable indicates that the queue is full. This is to
203 * avoid cache-line ping-pong between the xmit path and the
208 * @empty_read_count: If the completion path has seen the queue as empty
210 * @read_count bitwise-added to %EF4_EMPTY_COUNT_VALID; otherwise 0.
215 unsigned queue; member
252 #define EF4_TX_CB_SIZE (1 << EF4_TX_CB_ORDER) - NET_IP_ALIGN
255 * struct ef4_rx_buffer - An Efx RX data buffer
280 * struct ef4_rx_page_state - Page-based rx buffer state
283 * Used to facilitate sharing dma mappings between recycled rx buffers
295 * struct ef4_rx_queue - An Efx RX queue
297 * @core_index: Index of network core RX queue. Will be >= 0 iff this
298 * is associated with a real RX queue.
303 * @flush_pending: Set when a RX flush is pending. Has the same lifetime as
305 * @added_count: Number of buffers added to the receive queue.
307 * @removed_count: Number of buffers removed from the receive queue.
318 * @page_ptr_mask: The number of pages in the RX recycle ring minus 1.
319 * @max_fill: RX descriptor maximum fill level (<= ring size)
320 * @fast_fill_trigger: RX descriptor fill level that will trigger a fast fill
322 * @min_fill: RX descriptor minimum non-zero fill level.
325 * @recycle_count: RX buffer recycle counter.
361 * struct ef4_channel - An Efx channel
363 * A channel comprises an event queue, at least one TX queue, at least
364 * one RX queue, and an associated tasklet for processing the event
365 * queue.
370 * @eventq_init: Event queue initialised flag
372 * @irq: IRQ number (MSI and MSI-X only)
378 * @eventq: Event queue buffer
379 * @eventq_mask: Event queue pointer mask
380 * @eventq_read_ptr: Event queue read pointer
387 * @n_rx_ip_hdr_chksum_err: Count of RX IP header checksum errors
388 * @n_rx_tcp_udp_chksum_err: Count of RX TCP and UDP checksum errors
392 * @n_skbuff_leaks: Count of skbuffs leaked due to RX overrun
393 * @n_rx_nodesc_trunc: Number of RX packets truncated and then dropped due to
395 * @n_rx_merge_events: Number of RX merged completion events
396 * @n_rx_merge_packets: Number of RX packets completed by merged events
401 * @rx_queue: RX queue for this channel
449 * struct ef4_msi_context - Context for each MSI
464 * struct ef4_channel_type - distinguishes traffic and extra channels
473 * @keep_eventq: Flag for whether event queue should be kept initialised
498 STRING_TABLE_LOOKUP((efx)->loopback_mode, ef4_loopback_mode)
512 #define EF4_INT_MODE_USE_MSI(x) (((x)->interrupt_mode) <= EF4_INT_MODE_MSI)
524 /* Pseudo bit-mask flow control field */
530 * struct ef4_link_state - Current state of the link
532 * @fd: Link is full-duplex
546 return left->up == right->up && left->fd == right->fd && in ef4_link_state_equal()
547 left->fc == right->fc && left->speed == right->speed; in ef4_link_state_equal()
551 * struct ef4_phy_operations - Efx PHY operations table
552 * @probe: Probe PHY and initialise efx->mdio.mode_support, efx->mdio.mmds,
553 * efx->loopback_modes.
564 * @test_name: Get the name of a PHY-specific test/result
591 * enum ef4_phy_mode - PHY operating mode flags
612 * struct ef4_hw_stat_desc - Description of a hardware statistic
615 * @dma_width: Width in bits (0 for non-DMA statistics)
616 * @offset: Offset within stats (ignored for non-DMA statistics)
627 /* Number of (single-bit) entries in a multicast filter hash */
637 * struct ef4_nic - an Efx NIC
658 * @irq_rx_adaptive: Adaptive IRQ moderation enabled for RX event queues
659 * @irq_rx_mod_step_us: Step size for IRQ moderation for RX event queues
660 * @irq_rx_moderation_us: IRQ moderation time for RX event queues
665 * @rx_queue: RX DMA queues
668 * @extra_channel_types: Types of extra (non-traffic) channels that
672 * @txq_stop_thresh: TX queue fill level at or above which we stop it.
673 * @txq_wake_thresh: TX queue fill level at or below which we wake it.
674 * @tx_dc_base: Base qword address in SRAM of TX queue descriptor caches
675 * @rx_dc_base: Base qword address in SRAM of RX queue descriptor caches
679 * @n_rx_channels: Number of channels used for RX (= number of RX queues)
681 * @rx_ip_align: RX DMA address offset to have IP header aligned in
683 * @rx_dma_len: Current maximum RX DMA length
684 * @rx_buffer_order: Order (log2) of number of pages for each RX buffer
685 * @rx_buffer_truesize: Amortised allocation size of an RX buffer,
687 * @rx_prefix_size: Size of RX prefix before packet data
688 * @rx_packet_hash_offset: Offset of RX flow hash from start of packet data
690 * @rx_packet_len_offset: Offset of RX packet length from start of packet data
693 * (valid only if channel->sync_timestamps_enabled; always negative)
699 * @irq_soft_enabled: Are IRQs soft-enabled? If not, IRQ handler will
702 * @irq_zero_count: Number of legacy IRQs seen with queue flags == 0
703 * @irq_level: IRQ level/index for IRQs not triggered by an event queue
704 * @selftest_work: Work item for asynchronous self-test
720 * @phy_data: PHY private data (including PHY-specific stats)
726 * @unicast_filter: Flag for Falcon-arch simple unicast filter.
728 * @multicast_hash: Multicast hash table for Falcon-arch.
731 * @fc_disable: When non-zero flow control is disabled. Typically used to
732 * ensure that network back pressure doesn't delay dma queue flushes.
737 * @loopback_selftest: Offline self-test private state
740 * @filter_state: Architecture-dependent filter table state
744 * @active_queues: Count of RX and TX queues that haven't been flushed and drained.
747 * @rxq_flush_outstanding: Count of number of RX flushes started but not yet
750 * @flush_wq: wait queue used by ef4_nic_flush_queues() to wait for flush completions.
759 * @n_rx_noskb_drops: Count of RX packets dropped due to failure to allocate an skb
906 return efx->net_dev->reg_state == NETREG_REGISTERED; in ef4_dev_registered()
911 return efx->port_num; in ef4_port_num()
923 * struct ef4_nic_type - Efx device type definition
940 * @fini_dmaq: Flush and finalise DMA queues (RX and TX queues)
966 * @irq_enable_master: Enable IRQs on the NIC. Each event queue must
969 * @irq_disable_non_ev: Disable non-event IRQs on the NIC. Each event
970 * queue must be separately disabled before this.
975 * @tx_probe: Allocate resources for TX queue
976 * @tx_init: Initialise TX queue on the NIC
977 * @tx_remove: Free resources for TX queue
980 * @rx_probe: Allocate resources for RX queue
981 * @rx_init: Initialise RX queue on the NIC
982 * @rx_remove: Free resources for RX queue
983 * @rx_write: Write RX descriptors and doorbell
985 * @ev_probe: Allocate resources for event queue
986 * @ev_init: Initialise event queue on the NIC
987 * @ev_fini: Deinitialise event queue on the NIC
988 * @ev_remove: Free resources for event queue
989 * @ev_process: Process events for a queue, up to the given NAPI quota
990 * @ev_read_ack: Acknowledge read events on a queue, rearming its IRQ
995 * @filter_update_rx_scatter: Update filters after change to rx scatter setting
999 * @filter_clear_rx: Remove all RX filters whose priority is less than or
1003 * @filter_get_rx_ids: Get list of RX filters at a given priority
1017 * @mtd_sync: Wait for write-back to complete on MTD partition. This
1023 * @rxd_ptr_tbl_base: RX descriptor ring base address
1025 * @evq_ptr_tbl_base: Event queue pointer table base address
1026 * @evq_rptr_tbl_base: Event queue read-pointer table base address
1028 * @rx_prefix_size: Size of RX prefix before packet data
1029 * @rx_hash_offset: Offset of RX flow hash within prefix
1031 * @rx_buffer_padding: Size of padding at end of RX packet
1169 EF4_BUG_ON_PARANOID(index >= efx->n_channels); in ef4_get_channel()
1170 return efx->channel[index]; in ef4_get_channel()
1175 for (_channel = (_efx)->channel[0]; \
1177 _channel = (_channel->channel + 1 < (_efx)->n_channels) ? \
1178 (_efx)->channel[_channel->channel + 1] : NULL)
1182 for (_channel = (_efx)->channel[(_efx)->n_channels - 1]; \
1184 _channel = _channel->channel ? \
1185 (_efx)->channel[_channel->channel - 1] : NULL)
1190 EF4_BUG_ON_PARANOID(index >= efx->n_tx_channels || in ef4_get_tx_queue()
1192 return &efx->channel[efx->tx_channel_offset + index]->tx_queue[type]; in ef4_get_tx_queue()
1197 return channel->channel - channel->efx->tx_channel_offset < in ef4_channel_has_tx_queues()
1198 channel->efx->n_tx_channels; in ef4_channel_has_tx_queues()
1206 return &channel->tx_queue[type]; in ef4_channel_get_tx_queue()
1211 return !(tx_queue->efx->net_dev->num_tc < 2 && in ef4_tx_queue_used()
1212 tx_queue->queue & EF4_TXQ_TYPE_HIGHPRI); in ef4_tx_queue_used()
1220 for (_tx_queue = (_channel)->tx_queue; \
1221 _tx_queue < (_channel)->tx_queue + EF4_TXQ_TYPES && \
1230 for (_tx_queue = (_channel)->tx_queue; \
1231 _tx_queue < (_channel)->tx_queue + EF4_TXQ_TYPES; \
1236 return channel->rx_queue.core_index >= 0; in ef4_channel_has_rx_queue()
1243 return &channel->rx_queue; in ef4_channel_get_rx_queue()
1246 /* Iterate over all RX queues belonging to a channel */
1251 for (_rx_queue = &(_channel)->rx_queue; \
1263 return ef4_rx_queue_channel(rx_queue)->channel; in ef4_rx_queue_index()
1266 /* Returns a pointer to the specified receive buffer in the RX
1267 * descriptor queue.
1272 return &rx_queue->buffer[index]; in ef4_rx_buffer()
1276 * EF4_MAX_FRAME_LEN - calculate maximum frame length
1284 * The 10G MAC requires 8-byte alignment on the frame
1287 * Re-clocking by the XGXS on RX can reduce an IPG to 32 bits (half an
1303 const struct net_device *net_dev = efx->net_dev; in ef4_supported_features()
1305 return net_dev->features | net_dev->hw_features; in ef4_supported_features()
1308 /* Get the current TX queue insert index. */
1312 return tx_queue->insert_count & tx_queue->ptr_mask; in ef4_tx_queue_get_insert_index()
1319 return &tx_queue->buffer[ef4_tx_queue_get_insert_index(tx_queue)]; in __ef4_tx_queue_get_insert_buffer()
1329 EF4_BUG_ON_PARANOID(buffer->len); in ef4_tx_queue_get_insert_buffer()
1330 EF4_BUG_ON_PARANOID(buffer->flags); in ef4_tx_queue_get_insert_buffer()
1331 EF4_BUG_ON_PARANOID(buffer->unmap_len); in ef4_tx_queue_get_insert_buffer()