drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.h- Extension
.h- Size
- 9828 bytes
- Lines
- 336
- 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.
- 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/kernel.hlinux/errno.hlinux/types.hlinux/debugfs.hlinux/list.hlinux/netdevice.hlinux/scatterlist.hlinux/skbuff.hlinux/vmalloc.hlinux/bitmap.h
Detected Declarations
struct cxgbi_pagepod_hdrstruct cxgbi_pagepodstruct cxgbi_task_tag_infostruct cxgbi_tag_formatstruct cxgbi_ppod_datastruct cxgbi_ppm_poolstruct cxgbi_ppmfunction cxgbi_ppm_is_ddp_tagfunction cxgbi_ppm_sw_tag_is_usablefunction cxgbi_ppm_make_non_ddp_tagfunction cxgbi_ppm_decode_non_ddp_tagfunction cxgbi_ppm_ddp_tag_get_idxfunction cxgbi_ppm_make_ddp_tagfunction cxgbi_ppm_get_tag_caller_datafunction cxgbi_ppm_ddp_tag_update_sw_bitsfunction cxgbi_ppm_ppod_clearfunction cxgbi_tagmask_check
Annotated Snippet
struct cxgbi_pagepod_hdr {
u32 vld_tid;
u32 pgsz_tag_clr;
u32 max_offset;
u32 page_offset;
u64 rsvd;
};
#define PPOD_PAGES_MAX 4
struct cxgbi_pagepod {
struct cxgbi_pagepod_hdr hdr;
__be64 addr[PPOD_PAGES_MAX + 1];
};
/* ddp tag format
* for a 32-bit tag:
* bit #
* 31 ..... ..... 0
* X Y...Y Z...Z, where
* ^ ^^^^^ ^^^^
* | | |____ when ddp bit = 0: color bits
* | |
* | |____ when ddp bit = 0: idx into the ddp memory region
* |
* |____ ddp bit: 0 - ddp tag, 1 - non-ddp tag
*
* [page selector:2] [sw/free bits] [0] [idx] [color:6]
*/
#define DDP_PGIDX_MAX 4
#define DDP_PGSZ_BASE_SHIFT 12 /* base page 4K */
struct cxgbi_task_tag_info {
unsigned char flags;
#define CXGBI_PPOD_INFO_FLAG_VALID 0x1
#define CXGBI_PPOD_INFO_FLAG_MAPPED 0x2
unsigned char cid;
unsigned short pg_shift;
unsigned int npods;
unsigned int idx;
unsigned int tag;
struct cxgbi_pagepod_hdr hdr;
int nents;
int nr_pages;
struct scatterlist *sgl;
};
struct cxgbi_tag_format {
unsigned char pgsz_order[DDP_PGIDX_MAX];
unsigned char pgsz_idx_dflt;
unsigned char free_bits:4;
unsigned char color_bits:4;
unsigned char idx_bits;
unsigned char rsvd_bits;
unsigned int no_ddp_mask;
unsigned int idx_mask;
unsigned int color_mask;
unsigned int idx_clr_mask;
unsigned int rsvd_mask;
};
struct cxgbi_ppod_data {
unsigned char pg_idx:2;
unsigned char color:6;
unsigned char chan_id;
unsigned short npods;
unsigned long caller_data;
};
/* per cpu ppm pool */
struct cxgbi_ppm_pool {
unsigned int base; /* base index */
unsigned int next; /* next possible free index */
spinlock_t lock; /* ppm pool lock */
unsigned long bmap[];
} ____cacheline_aligned_in_smp;
struct cxgbi_ppm {
struct kref refcnt;
struct net_device *ndev; /* net_device, 1st port */
struct pci_dev *pdev;
void *lldev;
void **ppm_pp;
struct cxgbi_tag_format tformat;
unsigned int ppmax;
unsigned int llimit;
unsigned int base_idx;
unsigned int pool_rsvd;
unsigned int pool_index_max;
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/errno.h`, `linux/types.h`, `linux/debugfs.h`, `linux/list.h`, `linux/netdevice.h`, `linux/scatterlist.h`, `linux/skbuff.h`.
- Detected declarations: `struct cxgbi_pagepod_hdr`, `struct cxgbi_pagepod`, `struct cxgbi_task_tag_info`, `struct cxgbi_tag_format`, `struct cxgbi_ppod_data`, `struct cxgbi_ppm_pool`, `struct cxgbi_ppm`, `function cxgbi_ppm_is_ddp_tag`, `function cxgbi_ppm_sw_tag_is_usable`, `function cxgbi_ppm_make_non_ddp_tag`.
- 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.