drivers/net/ethernet/amazon/ena/ena_com.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/amazon/ena/ena_com.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/amazon/ena/ena_com.h- Extension
.h- Size
- 35302 bytes
- Lines
- 1141
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/compiler.hlinux/delay.hlinux/dma-mapping.hlinux/gfp.hlinux/io.hlinux/prefetch.hlinux/sched.hlinux/sizes.hlinux/spinlock.hlinux/types.hlinux/wait.hlinux/netdevice.hena_common_defs.hena_admin_defs.hena_eth_io_defs.hena_regs_defs.h
Detected Declarations
struct ena_llq_configurationsstruct ena_com_bufstruct ena_com_rx_buf_infostruct ena_com_io_desc_addrstruct ena_com_tx_metastruct ena_com_llq_infostruct ena_com_io_cqstruct ena_com_io_bounce_buffer_controlstruct ena_com_llq_pkt_ctrlstruct ena_com_io_sqstruct ena_com_admin_cqstruct ena_com_admin_sqstruct ena_com_stats_adminstruct ena_com_stats_phcstruct ena_com_admin_queuestruct ena_aenq_handlersstruct ena_com_aenqstruct ena_com_mmio_readstruct ena_com_phc_infostruct ena_rssstruct ena_customer_metricsstruct ena_host_attributestruct ena_com_devstruct ena_com_dev_get_features_ctxstruct ena_com_create_io_ctxstruct ena_aenq_handlersenum queue_directionfunction ena_com_get_adaptive_moderation_enabledfunction ena_com_enable_adaptive_moderationfunction ena_com_disable_adaptive_moderationfunction ena_com_get_capfunction ena_com_get_customer_metric_supportfunction ena_com_get_customer_metric_countfunction ena_com_update_intr_reg
Annotated Snippet
struct ena_llq_configurations {
enum ena_admin_llq_header_location llq_header_location;
enum ena_admin_llq_ring_entry_size llq_ring_entry_size;
enum ena_admin_llq_stride_ctrl llq_stride_ctrl;
enum ena_admin_llq_num_descs_before_header llq_num_decs_before_header;
u16 llq_ring_entry_size_value;
};
enum queue_direction {
ENA_COM_IO_QUEUE_DIRECTION_TX,
ENA_COM_IO_QUEUE_DIRECTION_RX
};
struct ena_com_buf {
dma_addr_t paddr; /**< Buffer physical address */
u16 len; /**< Buffer length in bytes */
};
struct ena_com_rx_buf_info {
u16 len;
u16 req_id;
};
struct ena_com_io_desc_addr {
u8 __iomem *pbuf_dev_addr; /* LLQ address */
u8 *virt_addr;
dma_addr_t phys_addr;
};
struct ena_com_tx_meta {
u16 mss;
u16 l3_hdr_len;
u16 l3_hdr_offset;
u16 l4_hdr_len; /* In words */
};
struct ena_com_llq_info {
u16 header_location_ctrl;
u16 desc_stride_ctrl;
u16 desc_list_entry_size_ctrl;
u16 desc_list_entry_size;
u16 descs_num_before_header;
u16 descs_per_entry;
u16 max_entries_in_tx_burst;
bool disable_meta_caching;
};
struct ena_com_io_cq {
struct ena_com_io_desc_addr cdesc_addr;
/* Interrupt unmask register */
u32 __iomem *unmask_reg;
/* numa configuration register (for TPH) */
u32 __iomem *numa_node_cfg_reg;
/* The value to write to the above register to unmask
* the interrupt of this queue
*/
u32 msix_vector ____cacheline_aligned;
enum queue_direction direction;
/* holds the number of cdesc of the current packet */
u16 cur_rx_pkt_cdesc_count;
/* save the first cdesc idx of the current packet */
u16 cur_rx_pkt_cdesc_start_idx;
u16 q_depth;
/* Caller qid */
u16 qid;
/* Device queue index */
u16 idx;
u16 head;
u8 phase;
u8 cdesc_entry_size_in_bytes;
} ____cacheline_aligned;
struct ena_com_io_bounce_buffer_control {
u8 *base_buffer;
u16 next_to_use;
u16 buffer_size;
u16 buffers_num; /* Must be a power of 2 */
};
/* This struct is to keep tracking the current location of the next llq entry */
struct ena_com_llq_pkt_ctrl {
u8 *curr_bounce_buf;
Annotation
- Immediate include surface: `linux/compiler.h`, `linux/delay.h`, `linux/dma-mapping.h`, `linux/gfp.h`, `linux/io.h`, `linux/prefetch.h`, `linux/sched.h`, `linux/sizes.h`.
- Detected declarations: `struct ena_llq_configurations`, `struct ena_com_buf`, `struct ena_com_rx_buf_info`, `struct ena_com_io_desc_addr`, `struct ena_com_tx_meta`, `struct ena_com_llq_info`, `struct ena_com_io_cq`, `struct ena_com_io_bounce_buffer_control`, `struct ena_com_llq_pkt_ctrl`, `struct ena_com_io_sq`.
- 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.