Lines Matching +full:dma +full:- +full:queues
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
65 * queues. */
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
99 * @dma_addr: DMA base address of the 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.
136 * @dma_addr: DMA address of the fragment.
137 * @flags: Flags for allocation and DMA mapping type
141 * @dma_offset: Offset of @dma_addr from the address of the backing DMA mapping.
161 * struct ef4_tx_queue - An Efx TX queue
174 * @queue: DMA queue number
179 * %EF4_TX_CB_ORDER into %EF4_TX_CB_SIZE-sized chunks.
188 * only get the up-to-date value of @write_count if this
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
203 * avoid cache-line ping-pong between the xmit path and the
210 * @read_count bitwise-added to %EF4_EMPTY_COUNT_VALID; otherwise 0.
252 #define EF4_TX_CB_SIZE (1 << EF4_TX_CB_ORDER) - NET_IP_ALIGN
255 * struct ef4_rx_buffer - An Efx RX data buffer
256 * @dma_addr: DMA base address of the buffer
259 * @page_offset: If pending: offset in @page of DMA base address.
261 * @len: If pending: length for DMA descriptor.
280 * struct ef4_rx_page_state - Page-based rx buffer state
283 * Used to facilitate sharing dma mappings between recycled rx buffers
286 * @dma_addr: The dma address of this page.
295 * struct ef4_rx_queue - An Efx RX queue
310 * @page_ring: The ring to store DMA mapped pages for reuse.
322 * @min_fill: RX descriptor minimum non-zero fill level.
361 * struct ef4_channel - An Efx channel
372 * @irq: IRQ number (MSI and MSI-X only)
402 * @tx_queue: TX queues for this channel
449 * struct ef4_msi_context - Context for each MSI
464 * struct ef4_channel_type - distinguishes traffic and extra channels
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
664 * @tx_queue: TX DMA queues
665 * @rx_queue: RX DMA queues
668 * @extra_channel_types: Types of extra (non-traffic) channels that
670 * @rxq_entries: Size of receive queues requested by user.
671 * @txq_entries: Size of transmit queues requested by user.
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
693 * (valid only if channel->sync_timestamps_enabled; always negative)
699 * @irq_soft_enabled: Are IRQs soft-enabled? If not, IRQ handler will
704 * @selftest_work: Work item for asynchronous self-test
717 * @stats_buffer: DMA buffer for statistics
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.
745 * @rxq_flush_pending: Count of number of receive queues that need to be flushed.
749 * flush receive queues.
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)
941 * @prepare_flush: Prepare the hardware for flushing the DMA queues
943 * @finish_flush: Clean up after flushing the DMA queues (for Falcon
969 * @irq_disable_non_ev: Disable non-event IRQs on the NIC. Each event
1017 * @mtd_sync: Wait for write-back to complete on MTD partition. This
1026 * @evq_rptr_tbl_base: Event queue read-pointer table base address
1027 * @max_dma_mask: Maximum possible DMA mask
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()
1215 /* Iterate over all TX queues belonging to a channel */
1220 for (_tx_queue = (_channel)->tx_queue; \
1221 _tx_queue < (_channel)->tx_queue + EF4_TXQ_TYPES && \
1225 /* Iterate over all possible TX queues belonging to a channel */
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()
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()
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()