STRUCT SRP_MAP_STATE(9)
π struct srp_map_state(9) π
okay so this is a page from the Kernel API Manual and it's all about struct srp_map_state β literally the per-request DMA memory mapping state. yes bestie, we're in the infiniband/srp trenches today π«Ά
β¨ NAME β¨
struct srp_map_state β per-request DMA memory mapping state. that's it, that's the vibe π
πΈ SYNOPSIS πΈ
struct srp_map_state {
union {
struct {
struct srp_fr_desc **next;
struct srp_fr_desc **end;
} fr;
struct {
void **next;
void **end;
} gen;
};
struct srp_direct_buf *desc;
union {
u64 *pages;
struct scatterlist *sg;
};
dma_addr_t base_dma_addr;
u32 dma_len;
u32 total_len;
unsigned int npages;
unsigned int nmdesc;
unsigned int ndesc;
};
no cap, that's the whole struct. two anonymous unions, a desc, a pages/sg union, and a bunch of counters. it's giving "bookkeeping queen" π
π¦ Members π¦
{unnamed_union}β anonymous. yes literally, it has no name, it's that mysterious πdescβ pointer to the element of the SRP buffer descriptor array that is being filled in rn. main character pointer energy β¨{unnamed_union}β anonymous again. another one. we love a mysterious union π«Άpagesβ array with DMA addresses of pages being considered for memory registration. like a little guest list of pages πbase_dma_addrβ DMA address of the first page that has not yet been mapped. the "next up" page, lowkey π―dma_lenβ number of bytes that will be registered with the next FR memory registration call. the upcoming batch size, fr fr π«total_lenβ total number of bytes in the sg-list being mapped. the whole entire thing πnpagesβ number of page addresses in thepages[]array. count 'em πnmdescβ number of FR memory descriptors used for mapping. more counting, we stay busy π§ndescβ number of SRP buffer descriptors that have been filled in. and that's the last counter, periodt π
β SEE ALSO β
- Kernel file
./drivers/infiniband/ulp/srp/ib_srp.hβ the source file, go read it iykyk π struct srp_rdma_ch(9)struct srp_target_port(9)struct srp_fr_desc(9)struct srp_fr_pool(9)
go click through those, they're all part of the same friend group honestly π
aaaand that's the page!! source is ./drivers/infiniband/ulp/srp, dated October 2026 β mwah, thanks for reading bestie, slay πππ₯
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms