IBV_CREATE_SRQ_EX(3)

πŸ“¦
version 65.0 Β· 2 versions
  • 65.0 Β· alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian bookworm, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 15.1 Β· freebsd 14.5, freebsd 15.1
, in alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian bookworm, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– IBV_CREATE_SRQ_EX(3) πŸ’–

okay bestie, welcome to the Libibverbs Programmer's Manual β€” today's main character is ibv_create_srq_ex (and its little sibling ibv_destroy_srq) πŸŽ€


✨ NAME ✨

ibv_create_srq_ex, ibv_destroy_srq β€” create or destroy a shared receive queue (SRQ) πŸ¦‹


🌸 SYNOPSIS 🌸

#include <infiniband/verbs.h>

struct ibv_srq *ibv_create_srq_ex(struct ibv_context *context, struct
                               ibv_srq_init_attr_ex *srq_init_attr_ex);

int ibv_destroy_srq(struct ibv_srq *srq);

πŸ’… DESCRIPTION πŸ’…

So like, ibv_create_srq_ex() creates a shared receive queue (SRQ) that supports both basic and xrc modes. no cap. 🫢 The argument srq_init_attr_ex is an ibv_srq_init_attr_ex struct, as defined in <infiniband/verbs.h>.

struct ibv_srq_init_attr_ex {
        void                   *srq_context;    /* Associated context of the SRQ */
        struct ibv_srq_attr     attr;           /* SRQ attributes */
        uint32_t                comp_mask;      /* Identifies valid fields */
        enum ibv_srq_type       srq_type;       /* Basic / XRC / tag matching */
        struct ibv_pd          *pd;             /* PD associated with the SRQ */
        struct ibv_xrcd        *xrcd;           /* XRC domain to associate with the SRQ */
        struct ibv_cq          *cq;             /* CQ to associate with the SRQ for XRC mode */
        struct ibv_tm_cap       tm_cap;         /* Tag matching attributes */
};

and the nested attr struct, she's giving structure ✨

struct ibv_srq_attr {
        uint32_t                max_wr;         /* Requested max number of outstanding work requests (WRs) in the SRQ */
        uint32_t                max_sge;        /* Requested max number of scatter elements per WR */
        uint32_t                srq_limit;      /* The limit value of the SRQ */
};

plus the tag matching capabilities, iconic πŸ’œ

struct ibv_tm_cap {
        uint32_t                max_num_tags;   /* Tag matching list size */
        uint32_t                max_ops;        /* Number of outstanding tag list operations */
};

The function ibv_create_srq_ex() will update the srq_init_attr_ex struct with the original values of the SRQ that was created β€” and bestie, listen: the values of max_wr and max_sge will be greater than or equal to the values you requested. she might give you more than you asked for, we love a generous queen πŸ‘‘

ibv_destroy_srq() destroys the SRQ srq. bye bye srq, you served πŸ’€


πŸ”₯ RETURN VALUE πŸ”₯

  • ibv_create_srq_ex() returns a pointer to the created SRQ, or NULL if the request fails. 😭
  • ibv_destroy_srq() returns 0 on success, or the value of errno on failure (which indicates the failure reason).

⚠️ NOTES ⚠️

ibv_destroy_srq() fails if any queue pair is still associated with this SRQ. so like… detach your QPs first, bestie, she will NOT let you leave with unfinished business 🚫

πŸ‘€ SEE ALSO πŸ‘€

go read those too, iykyk πŸ“š


πŸŽ€ AUTHORS πŸŽ€

Yishai Hadas <yishaih@mellanox.com> β€” thank you for your service king πŸ«‘πŸ’–


and that's the whole vibe, bestie ✨ this page came from the libibverbs era, dated 2013-06-26, and it's been slaying ever since. go create some SRQs, you got this πŸ’…πŸŒˆβ­

πŸ“¦ where this page comes from