STRUCT SRP_MAP_STATE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 the pages[] 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