include/linux/qed/qed_chain.h
Source file repositories/reference/linux-study-clean/include/linux/qed/qed_chain.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/qed/qed_chain.h- Extension
.h- Size
- 16929 bytes
- Lines
- 639
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.hasm/byteorder.hlinux/kernel.hlinux/list.hlinux/sizes.hlinux/slab.hlinux/qed/common_hsi.h
Detected Declarations
struct qed_chain_nextstruct qed_chain_pbl_u16struct qed_chain_pbl_u32struct qed_chain_u16struct qed_chain_u32struct addr_tbl_entrystruct qed_chainstruct qed_chain_init_paramsenum qed_chain_modeenum qed_chain_use_modeenum qed_chain_cnt_typefunction UNUSABLE_ELEMS_PER_PAGEfunction qed_chain_get_cons_idxfunction qed_chain_get_prod_idx_u32function qed_chain_get_cons_idx_u32function qed_chain_get_elem_usedfunction qed_chain_get_elem_leftfunction qed_chain_get_elem_used_u32function qed_chain_get_elem_left_u32function qed_chain_get_usable_per_pagefunction qed_chain_get_unusable_per_pagefunction qed_chain_get_page_cntfunction qed_chain_get_pbl_physfunction qed_chain_advance_pagefunction qed_chain_return_producedfunction qed_chain_producefunction qed_chain_get_capacityfunction qed_chain_recycle_consumedfunction qed_chain_consumefunction qed_chain_resetfunction qed_chain_get_last_elemfunction qed_chain_set_prodfunction qed_chain_pbl_zero_mem
Annotated Snippet
struct qed_chain_next {
struct regpair next_phys;
void *next_virt;
};
struct qed_chain_pbl_u16 {
u16 prod_page_idx;
u16 cons_page_idx;
};
struct qed_chain_pbl_u32 {
u32 prod_page_idx;
u32 cons_page_idx;
};
struct qed_chain_u16 {
/* Cyclic index of next element to produce/consume */
u16 prod_idx;
u16 cons_idx;
};
struct qed_chain_u32 {
/* Cyclic index of next element to produce/consume */
u32 prod_idx;
u32 cons_idx;
};
struct addr_tbl_entry {
void *virt_addr;
dma_addr_t dma_map;
};
struct qed_chain {
/* Fastpath portion of the chain - required for commands such
* as produce / consume.
*/
/* Point to next element to produce/consume */
void *p_prod_elem;
void *p_cons_elem;
/* Fastpath portions of the PBL [if exists] */
struct {
/* Table for keeping the virtual and physical addresses of the
* chain pages, respectively to the physical addresses
* in the pbl table.
*/
struct addr_tbl_entry *pp_addr_tbl;
union {
struct qed_chain_pbl_u16 u16;
struct qed_chain_pbl_u32 u32;
} c;
} pbl;
union {
struct qed_chain_u16 chain16;
struct qed_chain_u32 chain32;
} u;
/* Capacity counts only usable elements */
u32 capacity;
u32 page_cnt;
enum qed_chain_mode mode;
/* Elements information for fast calculations */
u16 elem_per_page;
u16 elem_per_page_mask;
u16 elem_size;
u16 next_page_mask;
u16 usable_per_page;
u8 elem_unusable;
enum qed_chain_cnt_type cnt_type;
/* Slowpath of the chain - required for initialization and destruction,
* but isn't involved in regular functionality.
*/
u32 page_size;
/* Base address of a pre-allocated buffer for pbl */
struct {
__le64 *table_virt;
dma_addr_t table_phys;
size_t table_size;
} pbl_sp;
Annotation
- Immediate include surface: `linux/types.h`, `asm/byteorder.h`, `linux/kernel.h`, `linux/list.h`, `linux/sizes.h`, `linux/slab.h`, `linux/qed/common_hsi.h`.
- Detected declarations: `struct qed_chain_next`, `struct qed_chain_pbl_u16`, `struct qed_chain_pbl_u32`, `struct qed_chain_u16`, `struct qed_chain_u32`, `struct addr_tbl_entry`, `struct qed_chain`, `struct qed_chain_init_params`, `enum qed_chain_mode`, `enum qed_chain_use_mode`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
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.