drivers/net/ethernet/broadcom/bnge/bnge_rmem.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/broadcom/bnge/bnge_rmem.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/broadcom/bnge/bnge_rmem.h- Extension
.h- Size
- 5421 bytes
- Lines
- 203
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
struct bnge_ctx_mem_typestruct bnge_devstruct bnge_netstruct bnge_ring_mem_infostruct bnge_ctx_pg_infostruct bnge_ctx_mem_typestruct bnge_ctx_mem_infostruct bnge_ring_struct
Annotated Snippet
struct bnge_ring_mem_info {
/* Number of pages to next level */
int nr_pages;
int page_size;
u16 flags;
#define BNGE_RMEM_VALID_PTE_FLAG 1
#define BNGE_RMEM_RING_PTE_FLAG 2
#define BNGE_RMEM_USE_FULL_PAGE_FLAG 4
u16 depth;
void **pg_arr;
dma_addr_t *dma_arr;
__le64 *pg_tbl;
dma_addr_t dma_pg_tbl;
int vmem_size;
void **vmem;
struct bnge_ctx_mem_type *ctx_mem;
};
/* The hardware supports certain page sizes.
* Use the supported page sizes to allocate the rings.
*/
#if (PAGE_SHIFT < 12)
#define BNGE_PAGE_SHIFT 12
#elif (PAGE_SHIFT <= 13)
#define BNGE_PAGE_SHIFT PAGE_SHIFT
#elif (PAGE_SHIFT < 16)
#define BNGE_PAGE_SHIFT 13
#else
#define BNGE_PAGE_SHIFT 16
#endif
#define BNGE_PAGE_SIZE (1 << BNGE_PAGE_SHIFT)
/* The RXBD length is 16-bit so we can only support page sizes < 64K */
#if (PAGE_SHIFT > 15)
#define BNGE_RX_PAGE_SHIFT 15
#else
#define BNGE_RX_PAGE_SHIFT PAGE_SHIFT
#endif
#define MAX_CTX_PAGES (BNGE_PAGE_SIZE / 8)
#define MAX_CTX_TOTAL_PAGES (MAX_CTX_PAGES * MAX_CTX_PAGES)
struct bnge_ctx_pg_info {
u32 entries;
u32 nr_pages;
void *ctx_pg_arr[MAX_CTX_PAGES];
dma_addr_t ctx_dma_arr[MAX_CTX_PAGES];
struct bnge_ring_mem_info ring_mem;
struct bnge_ctx_pg_info **ctx_pg_tbl;
};
#define BNGE_MAX_TQM_SP_RINGS 1
#define BNGE_MAX_TQM_FP_RINGS 8
#define BNGE_MAX_TQM_RINGS \
(BNGE_MAX_TQM_SP_RINGS + BNGE_MAX_TQM_FP_RINGS)
#define BNGE_BACKING_STORE_CFG_LEGACY_LEN 256
#define BNGE_SET_CTX_PAGE_ATTR(attr) \
do { \
if (BNGE_PAGE_SIZE == 0x2000) \
attr = FUNC_BACKING_STORE_CFG_REQ_SRQ_PG_SIZE_PG_8K; \
else if (BNGE_PAGE_SIZE == 0x10000) \
attr = FUNC_BACKING_STORE_CFG_REQ_QPC_PG_SIZE_PG_64K; \
else \
attr = FUNC_BACKING_STORE_CFG_REQ_QPC_PG_SIZE_PG_4K; \
} while (0)
#define BNGE_CTX_MRAV_AV_SPLIT_ENTRY 0
#define BNGE_CTX_QP \
FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_QP
#define BNGE_CTX_SRQ \
FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_SRQ
#define BNGE_CTX_CQ \
FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_CQ
#define BNGE_CTX_VNIC \
FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_VNIC
#define BNGE_CTX_STAT \
FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_STAT
#define BNGE_CTX_STQM \
FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_SP_TQM_RING
#define BNGE_CTX_FTQM \
FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_FP_TQM_RING
#define BNGE_CTX_MRAV \
FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_MRAV
#define BNGE_CTX_TIM \
FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_TIM
#define BNGE_CTX_TCK \
Annotation
- Detected declarations: `struct bnge_ctx_mem_type`, `struct bnge_dev`, `struct bnge_net`, `struct bnge_ring_mem_info`, `struct bnge_ctx_pg_info`, `struct bnge_ctx_mem_type`, `struct bnge_ctx_mem_info`, `struct bnge_ring_struct`.
- Atlas domain: Driver Families / drivers/net.
- 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.