STRUCT SRPT_DEVICE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct srpt_device(9) β€” like, the whole kernel API manual but make it make sense

okay so bestie, welcome to the struct srpt_device(9) glow-up ✨ this is the kernel API manual page for struct srpt_device, and we're about to get into it. no cap, it's giving "one struct to hold all the HCA info" and honestly? iconic.


🌸 NAME 🌸

struct srpt_device β€” the info that SRPT keeps around for a single HCA πŸ’– (yes, one whole HCA. main character energy fr fr)


πŸ¦‹ SYNOPSIS πŸ¦‹

like, here's the literal struct, copy-paste it exactly, do not come for me:

struct srpt_device {
    struct kref             refcnt;
    struct ib_device        *device;
    struct ib_pd            *pd;
    u32 lkey;
    struct ib_srq           *srq;
    struct ib_cm_id         *cm_id;
    int srq_size;
    struct mutex            sdev_mutex;
    bool use_srq;
    struct kmem_cache       *req_buf_cache;
    struct srpt_recv_ioctx  **ioctx_ring;
    struct ib_event_handler event_handler;
    struct list_head        list;
    struct srpt_port        port[];
};

πŸŽ€ Members πŸŽ€

okay now the vibe check on every single field, no skipping, we don't do that here 🫢

  • refcnt β€” the reference count for this device. it's literally counting refs, that's the whole job πŸ’…
  • device β€” a backpointer to the struct ib_device that the IB core manages πŸ‘‘
  • pd β€” the IB protection domain πŸ›‘οΈ
  • lkey β€” the L_Key (local key) that has write access to, like, all local memory πŸ”₯ big permissions energy.
  • srq β€” the per-HCA SRQ, aka the shared receive queue 🌈
  • cm_id β€” the connection identifier ✨
  • srq_size β€” the SRQ size, which is... the size of the SRQ πŸ™ˆ
  • sdev_mutex β€” serializes use_srq changes πŸ”’ so like, one at a time please.
  • use_srq β€” whether or not to use SRQ. a simple yes/no king πŸ‘‘
  • req_buf_cache β€” the kmem_cache for ioctx_ring buffers 🧺 caching, but make it buffers.
  • ioctx_ring β€” per-HCA SRQ. (yes, same description as srq, I don't make the rules, I just report them πŸ’€)
  • event_handler β€” the per-HCA asynchronous IB event handler πŸ¦‹ catching events, staying booked and busy.
  • list β€” the node in srpt_dev_list πŸ”— linked-list realness.
  • port β€” info about the ports owned by this HCA βš“ (it's an array, port[], noted πŸŽ€)

⭐ SEE ALSO ⭐

go read these next, bestie, it's a whole universe:

  • Kernel file ./drivers/infiniband/ulp/srpt/ib_srpt.h enum
  • srpt_command_state(9)
  • struct srpt_ioctx(9)
  • struct srpt_recv_ioctx(9)
  • struct srpt_send_ioctx(9)
  • enum rdma_ch_state(9)
  • struct srpt_rdma_ch(9)
  • struct srpt_nexus(9)
  • struct srpt_port_attrib(9)
  • struct srpt_tpg(9)
  • struct srpt_port_id(9)
  • struct srpt_port(9)

πŸ’– cute lil sign-off: this page lives in ./drivers/infiniband/ulp/srpt, dated October 2026, and yeah it's still struct srpt_device(9) at the bottom, periodt. πŸŽ€βœ¨
πŸ“¦ where this page comes from