drivers/net/ethernet/sfc/net_driver.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/sfc/net_driver.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/sfc/net_driver.h- Extension
.h- Size
- 67754 bytes
- Lines
- 1803
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/netdevice.hlinux/etherdevice.hlinux/ethtool.hlinux/if_vlan.hlinux/timer.hlinux/mii.hlinux/list.hlinux/pci.hlinux/device.hlinux/highmem.hlinux/workqueue.hlinux/mutex.hlinux/rwsem.hlinux/vmalloc.hlinux/mtd/mtd.hnet/busy_poll.hnet/xdp.hnet/netevent.henum.hbitfield.hfilter.h
Detected Declarations
struct efx_ptp_datastruct hwtstamp_configstruct efx_self_testsstruct efx_bufferstruct efx_tx_bufferstruct efx_tx_queuestruct efx_rx_bufferstruct efx_rx_page_statestruct efx_rx_queuestruct efx_channelstruct efx_msi_contextstruct efx_channel_typestruct efx_nicstruct efx_link_statestruct efx_hw_stat_descstruct vfdi_statusstruct efx_rss_context_privstruct efx_rss_contextstruct efx_arfs_rulestruct efx_async_filter_insertionstruct efx_maestruct efx_nicstruct efx_probe_datastruct efx_mtd_partitionstruct efx_udp_tunnelstruct efx_nic_typeenum efx_sync_events_stateenum efx_led_modeenum efx_int_modeenum nic_stateenum efx_phy_modeenum efx_xdp_tx_queues_modefunction efx_net_activefunction efx_frozenfunction efx_recoveringfunction efx_freezefunction efx_thawfunction efx_recoverfunction efx_recoveredfunction efx_link_state_equalfunction efx_phy_mode_disabledfunction efx_dev_registeredfunction efx_port_numfunction efx_get_channelfunction efx_get_tx_channelfunction efx_get_xdp_channelfunction efx_channel_is_xdp_txfunction efx_channel_has_tx_queues
Annotated Snippet
struct efx_buffer {
void *addr;
dma_addr_t dma_addr;
unsigned int len;
};
/**
* struct efx_tx_buffer - buffer state for a TX descriptor
* @skb: When @flags & %EFX_TX_BUF_SKB, the associated socket buffer to be
* freed when descriptor completes
* @xdpf: When @flags & %EFX_TX_BUF_XDP, the XDP frame information; its @data
* member is the associated buffer to drop a page reference on.
* @option: When @flags & %EFX_TX_BUF_OPTION, an EF10-specific option
* descriptor.
* @dma_addr: DMA address of the fragment.
* @flags: Flags for allocation and DMA mapping type
* @len: Length of this fragment.
* This field is zero when the queue slot is empty.
* @unmap_len: Length of this fragment to unmap
* @dma_offset: Offset of @dma_addr from the address of the backing DMA mapping.
* Only valid if @unmap_len != 0.
*/
struct efx_tx_buffer {
union {
const struct sk_buff *skb;
struct xdp_frame *xdpf;
};
union {
efx_qword_t option; /* EF10 */
dma_addr_t dma_addr;
};
unsigned short flags;
unsigned short len;
unsigned short unmap_len;
unsigned short dma_offset;
};
#define EFX_TX_BUF_CONT 1 /* not last descriptor of packet */
#define EFX_TX_BUF_SKB 2 /* buffer is last part of skb */
#define EFX_TX_BUF_MAP_SINGLE 8 /* buffer was mapped with dma_map_single() */
#define EFX_TX_BUF_OPTION 0x10 /* empty buffer for option descriptor */
#define EFX_TX_BUF_XDP 0x20 /* buffer was sent with XDP */
#define EFX_TX_BUF_TSO_V3 0x40 /* empty buffer for a TSO_V3 descriptor */
#define EFX_TX_BUF_EFV 0x100 /* buffer was sent from representor */
/**
* struct efx_tx_queue - An Efx TX queue
*
* This is a ring buffer of TX fragments.
* Since the TX completion path always executes on the same
* CPU and the xmit path can operate on different CPUs,
* performance is increased by ensuring that the completion
* path and the xmit path operate on different cache lines.
* This is particularly important if the xmit path is always
* executing on one CPU which is different from the completion
* path. There is also a cache line for members which are
* read but not written on the fast path.
*
* @efx: The associated Efx NIC
* @queue: DMA queue number
* @label: Label for TX completion events.
* Is our index within @channel->tx_queue array.
* @type: configuration type of this TX queue. A bitmask of %EFX_TXQ_TYPE_* flags.
* @tso_version: Version of TSO in use for this queue.
* @tso_encap: Is encapsulated TSO supported? Supported in TSOv2 on 8000 series.
* @channel: The associated channel
* @core_txq: The networking core TX queue structure
* @buffer: The software buffer ring
* @cb_page: Array of pages of copy buffers. Carved up according to
* %EFX_TX_CB_ORDER into %EFX_TX_CB_SIZE-sized chunks.
* @txd: The hardware descriptor ring
* @ptr_mask: The size of the ring minus 1.
* @piobuf: PIO buffer region for this TX queue (shared with its partner).
* Size of the region is efx_piobuf_size.
* @piobuf_offset: Buffer offset to be specified in PIO descriptors
* @initialised: Has hardware queue been initialised?
* @timestamping: Is timestamping enabled for this channel?
* @xdp_tx: Is this an XDP tx queue?
* @old_complete_packets: Value of @complete_packets as of last
* efx_init_tx_queue()
* @old_complete_bytes: Value of @complete_bytes as of last
* efx_init_tx_queue()
* @old_tso_bursts: Value of @tso_bursts as of last efx_init_tx_queue()
* @old_tso_packets: Value of @tso_packets as of last efx_init_tx_queue()
* @read_count: Current read pointer.
* This is the number of buffers that have been removed from both rings.
* @old_write_count: The value of @write_count when last checked.
* This is here for performance reasons. The xmit path will
* only get the up-to-date value of @write_count if this
* variable indicates that the queue is empty. This is to
* avoid cache-line ping-pong between the xmit path and the
Annotation
- Immediate include surface: `linux/netdevice.h`, `linux/etherdevice.h`, `linux/ethtool.h`, `linux/if_vlan.h`, `linux/timer.h`, `linux/mii.h`, `linux/list.h`, `linux/pci.h`.
- Detected declarations: `struct efx_ptp_data`, `struct hwtstamp_config`, `struct efx_self_tests`, `struct efx_buffer`, `struct efx_tx_buffer`, `struct efx_tx_queue`, `struct efx_rx_buffer`, `struct efx_rx_page_state`, `struct efx_rx_queue`, `struct efx_channel`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.