STRUCT QP_INFO(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

struct qp_info β€” the QP (share queue region) attributes structure, bestie. Basically the whole personality of an offloaded connection's queues in one struct 🫢


✨ SYNOPSIS ✨

struct qp_info {
    void __iomem *ctx_base;
  #define DPM_TRIGER_TYPE                 0x40;
  #define BNX2I_570x_QUE_DB_SIZE          0;
  #define BNX2I_5771x_QUE_DB_SIZE         16;
    struct sqe *sq_virt;
    dma_addr_t sq_phys;
    u32 sq_mem_size;
    struct sqe *sq_prod_qe;
    struct sqe *sq_cons_qe;
    struct sqe *sq_first_qe;
    struct sqe *sq_last_qe;
    u16 sq_prod_idx;
    u16 sq_cons_idx;
    u32 sqe_left;
    void *sq_pgtbl_virt;
    dma_addr_t sq_pgtbl_phys;
    u32 sq_pgtbl_size;
    struct cqe *cq_virt;
    dma_addr_t cq_phys;
    u32 cq_mem_size;
    struct cqe *cq_prod_qe;
    struct cqe *cq_cons_qe;
    struct cqe *cq_first_qe;
    struct cqe *cq_last_qe;
    u16 cq_prod_idx;
    u16 cq_cons_idx;
    u32 cqe_left;
    u32 cqe_size;
    u32 cqe_exp_seq_sn;
    void *cq_pgtbl_virt;
    dma_addr_t cq_pgtbl_phys;
    u32 cq_pgtbl_size;
    struct rqe *rq_virt;
    dma_addr_t rq_phys;
    u32 rq_mem_size;
    struct rqe *rq_prod_qe;
    struct rqe *rq_cons_qe;
    struct rqe *rq_first_qe;
    struct rqe *rq_last_qe;
    u16 rq_prod_idx;
    u16 rq_cons_idx;
    u32 rqe_left;
    void *rq_pgtbl_virt;
    dma_addr_t rq_pgtbl_phys;
    u32 rq_pgtbl_size;
};

πŸŽ€ Members πŸŽ€

Three whole queue squads live in here β€” SQ, CQ and RQ β€” plus their page tables. Meet the cast πŸ’…

  • ctx_base β€” the ioremapped PCI register base you use to poke the doorbell register that belongs to this offloaded connection. It's the "hey, I'm done" button, lowkey πŸ””

the send queue (SQ) era

  • sq_virt β€” virtual address of the send queue (SQ) region
  • sq_phys β€” DMA address of the SQ memory region
  • sq_mem_size β€” SQ size
  • sq_prod_qe β€” SQ producer entry pointer
  • sq_cons_qe β€” SQ consumer entry pointer
  • sq_first_qe β€” virtual address of the first entry in SQ
  • sq_last_qe β€” virtual address of the last entry in SQ
  • sq_prod_idx β€” SQ producer index
  • sq_cons_idx β€” SQ consumer index
  • sqe_left β€” number of SQ entries left
  • sq_pgtbl_virt β€” page table describing the buffer constituting the SQ region
  • sq_pgtbl_phys β€” DMA address of sq_pgtbl_virt
  • sq_pgtbl_size β€” SQ page table size

the completion queue (CQ) era

  • cq_virt β€” virtual address of the completion queue (CQ) region
  • cq_phys β€” DMA address of the RQ memory region
  • cq_mem_size β€” CQ size
  • cq_prod_qe β€” CQ producer entry pointer
  • cq_cons_qe β€” CQ consumer entry pointer
  • cq_first_qe β€” virtual address of the first entry in CQ
  • cq_last_qe β€” virtual address of the last entry in CQ
  • cq_prod_idx β€” CQ producer index
  • cq_cons_idx β€” CQ consumer index
  • cqe_left β€” number of CQ entries left
  • cqe_size β€” size of each CQ entry
  • cqe_exp_seq_sn β€” next expected CQE sequence number πŸ”’
  • cq_pgtbl_virt β€” page table describing the buffer constituting the CQ region
  • cq_pgtbl_phys β€” DMA address of cq_pgtbl_virt
  • cq_pgtbl_size β€” CQ page table size

the receive queue (RQ) era

  • rq_virt β€” virtual address of the receive queue (RQ) region
  • rq_phys β€” DMA address of the RQ memory region
  • rq_mem_size β€” RQ size
  • rq_prod_qe β€” RQ producer entry pointer
  • rq_cons_qe β€” RQ consumer entry pointer
  • rq_first_qe β€” virtual address of the first entry in RQ
  • rq_last_qe β€” virtual address of the last entry in RQ
  • rq_prod_idx β€” RQ producer index
  • rq_cons_idx β€” RQ consumer index
  • rqe_left β€” number of RQ entries left
  • rq_pgtbl_virt β€” page table describing the buffer constituting the RQ region
  • rq_pgtbl_phys β€” DMA address of rq_pgtbl_virt
  • rq_pgtbl_size β€” RQ page table size

πŸ¦‹ Description πŸ¦‹

Okay so picture this: a queue pair (QP) is a per-connection shared data structure. It's the main character for three jobs β€” sending work requests (SQ), receiving completion notifications (CQ), and receiving asynchronous / scsi sense info (RQ). The qp_info structure below holds the queue memory, the consumer/producer indexes, and the page table information for all of it ✨

Heads up bestie: the defines in the synopsis are literally named DPM_TRIGER_TYPE, BNX2I_570x_QUE_DB_SIZE and BNX2I_5771x_QUE_DB_SIZE β€” spell them exactly like that, typos and all, or the compiler will absolutely humble you 😭

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./drivers/scsi/bnx2i/bnx2i.h β€” go read up on struct generic_pdu_resc(9), struct bd_resc_page(9), struct io_bdt(9), struct bnx2i_conn(9), struct iscsi_cid_queue(9), struct bnx2i_hba(9), struct bnx2i_endpoint(9). The whole friend group fr fr 🫢


That's the whole vibe check πŸ’œ This page came from ./drivers/scsi/bnx2i, dated October 2026 β€” struct qp_info(9), slay, no cap, periodt πŸŽ€βœ¨

πŸ“¦ where this page comes from