IBV_MODIFY_SRQ(3)

πŸ’– IBV_MODIFY_SRQ πŸ’–

okay bestie, welcome to ibv_modify_srq β€” a page straight out of the Libibverbs Programmer's Manual, and yes it's giving main character energy πŸŽ€


✨ NAME ✨

ibv_modify_srq β€” modify attributes of a shared receive queue (SRQ) πŸ¦‹


✨ SYNOPSIS ✨

#include <infiniband/verbs.h>

int ibv_modify_srq(struct ibv_srq *srq,
                   struct ibv_srq_attr *srq_attr,
                   int srq_attr_mask);

✨ DESCRIPTION ✨

so like, ibv_modify_srq() takes your SRQ srq and changes its attributes to whatever's in srq_attr, following the mask srq_attr_mask. it's literally a glow-up for your SRQ πŸ’…

the srq_attr argument is a ibv_srq_attr struct, as defined in <infiniband/verbs.h> (iconic header, no cap):

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

the srq_attr_mask argument says which SRQ attributes you actually wanna modify. it's either 0 or the bitwise OR of one or more of these flags πŸ‘‡

  • IBV_SRQ_MAX_WR β€” Resize the SRQ 🌈
  • IBV_SRQ_LIMIT β€” Set the SRQ limit ⭐

✨ RETURN VALUE ✨

ibv_modify_srq() returns 0 on success 🫢 or the value of errno on failure (which tells you why it flopped, bestie). 😭


✨ NOTES ✨

  • If any of the modify attributes is invalid, none of the attributes will be modified. it's all-or-nothing, periodt πŸ’€
  • Not all devices support resizing SRQs. to check if a device supports it, check if the IBV_DEVICE_SRQ_RESIZE bit is set in the device capabilities flags. πŸ”
  • Modifying the srq_limit arms the SRQ to produce an IBV_EVENT_SRQ_LIMIT_REACHED "low watermark" asynchronous event once the number of WRs in the SRQ drops below srq_limit. so dramatic, we love a low watermark moment 🌊

✨ SEE ALSO ✨

ibv_query_device(3), ibv_create_srq(3), ibv_destroy_srq(3), ibv_query_srq(3) β€” the whole friend group, go read them 🫢


✨ AUTHORS ✨

Dotan Barak <dotanba@gmail.com> β€” thank you for your service, king πŸ‘‘


and that's the tea, bestie πŸ“ this page came from libibverbs and it's dated 2006-10-31 β€” vintage, but the vibes are still immaculate πŸ’œ

πŸ“¦ where this page comes from