drivers/net/ethernet/google/gve/gve.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/google/gve/gve.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/google/gve/gve.h- Extension
.h- Size
- 40558 bytes
- Lines
- 1348
- 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/dma-mapping.hlinux/dmapool.hlinux/ethtool_netlink.hlinux/netdevice.hlinux/net_tstamp.hlinux/pci.hlinux/ptp_clock_kernel.hlinux/u64_stats_sync.hnet/page_pool/helpers.hnet/xdp.hgve_desc.hgve_desc_dqo.h
Detected Declarations
struct gve_rx_desc_queuestruct gve_rx_slot_page_infostruct gve_queue_page_liststruct gve_rx_data_queuestruct gve_privstruct gve_rx_buf_queue_dqostruct gve_rx_compl_queue_dqostruct gve_header_bufstruct gve_rx_buf_state_dqostruct gve_xdp_buffstruct gve_index_liststruct gve_rx_ctxstruct gve_rx_cntsstruct gve_rx_ringstruct gve_tx_iovecstruct gve_tx_buffer_statestruct gve_tx_fifostruct gve_tx_pending_packet_dqostruct gve_tx_ringstruct gve_notify_blockstruct gve_rx_queue_configstruct gve_tx_queue_configstruct gve_qpl_configstruct gve_irq_dbstruct gve_ptypestruct gve_ptype_lutstruct gve_tx_alloc_rings_cfgstruct gve_rx_alloc_rings_cfgstruct gve_flow_specstruct gve_flow_rulestruct gve_flow_rules_cachestruct gve_rss_configstruct gve_ptpstruct gve_privenum gve_packet_stateenum gve_tx_pending_packet_dqo_typeenum gve_queue_formatenum gve_service_task_flags_bitenum gve_state_flags_bitenum gve_ethtool_flags_bitfunction gve_get_do_resetfunction gve_set_do_resetfunction gve_clear_do_resetfunction gve_get_reset_in_progressfunction gve_set_reset_in_progressfunction gve_clear_reset_in_progressfunction gve_get_probe_in_progressfunction gve_set_probe_in_progress
Annotated Snippet
struct gve_rx_desc_queue {
struct gve_rx_desc *desc_ring; /* the descriptor ring */
dma_addr_t bus; /* the bus for the desc_ring */
u8 seqno; /* the next expected seqno for this desc*/
};
/* The page info for a single slot in the RX data queue */
struct gve_rx_slot_page_info {
/* netmem is used for DQO RDA mode
* page is used in all other modes
*/
union {
struct page *page;
netmem_ref netmem;
};
void *page_address;
u32 page_offset; /* offset to write to in page */
unsigned int buf_size;
int pagecnt_bias; /* expected pagecnt if only the driver has a ref */
u16 pad; /* adjustment for rx padding */
u8 can_flip; /* tracks if the networking stack is using the page */
};
/* A list of pages registered with the device during setup and used by a queue
* as buffers
*/
struct gve_queue_page_list {
u32 id; /* unique id */
u32 num_entries;
struct page **pages; /* list of num_entries pages */
dma_addr_t *page_buses; /* the dma addrs of the pages */
};
/* Each slot in the data ring has a 1:1 mapping to a slot in the desc ring */
struct gve_rx_data_queue {
union gve_rx_data_slot *data_ring; /* read by NIC */
dma_addr_t data_bus; /* dma mapping of the slots */
struct gve_rx_slot_page_info *page_info; /* page info of the buffers */
struct gve_queue_page_list *qpl; /* qpl assigned to this queue */
u8 raw_addressing; /* use raw_addressing? */
};
struct gve_priv;
/* RX buffer queue for posting buffers to HW.
* Each RX (completion) queue has a corresponding buffer queue.
*/
struct gve_rx_buf_queue_dqo {
struct gve_rx_desc_dqo *desc_ring;
dma_addr_t bus;
u32 head; /* Pointer to start cleaning buffers at. */
u32 tail; /* Last posted buffer index + 1 */
u32 mask; /* Mask for indices to the size of the ring */
};
/* RX completion queue to receive packets from HW. */
struct gve_rx_compl_queue_dqo {
struct gve_rx_compl_desc_dqo *desc_ring;
dma_addr_t bus;
/* Number of slots which did not have a buffer posted yet. We should not
* post more buffers than the queue size to avoid HW overrunning the
* queue.
*/
int num_free_slots;
/* HW uses a "generation bit" to notify SW of new descriptors. When a
* descriptor's generation bit is different from the current generation,
* that descriptor is ready to be consumed by SW.
*/
u8 cur_gen_bit;
/* Pointer into desc_ring where the next completion descriptor will be
* received.
*/
u32 head;
u32 mask; /* Mask for indices to the size of the ring */
};
struct gve_header_buf {
u8 *data;
dma_addr_t addr;
};
/* Stores state for tracking buffers posted to HW */
struct gve_rx_buf_state_dqo {
/* The page posted to HW. */
struct gve_rx_slot_page_info page_info;
/* XSK buffer */
Annotation
- Immediate include surface: `linux/dma-mapping.h`, `linux/dmapool.h`, `linux/ethtool_netlink.h`, `linux/netdevice.h`, `linux/net_tstamp.h`, `linux/pci.h`, `linux/ptp_clock_kernel.h`, `linux/u64_stats_sync.h`.
- Detected declarations: `struct gve_rx_desc_queue`, `struct gve_rx_slot_page_info`, `struct gve_queue_page_list`, `struct gve_rx_data_queue`, `struct gve_priv`, `struct gve_rx_buf_queue_dqo`, `struct gve_rx_compl_queue_dqo`, `struct gve_header_buf`, `struct gve_rx_buf_state_dqo`, `struct gve_xdp_buff`.
- 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.