manadv_init_obj(3)

πŸ¦‹ manadv_init_obj β€” the NAME bit πŸ¦‹

okay so bestie, this page is literally all about manadv_init_obj(3) β€” the glow-up function that hands you real, live mana direct verbs objects built from your boring old ibv_xxx structs. it's in section 3 of the manual, iykyk πŸ’…


✨ SYNOPSIS ✨

#include <infiniband/manadv.h>

int manadv_init_obj(struct manadv_obj *obj, uint64_t obj_type);

πŸ’– DESCRIPTION πŸ’–

so manadv_init_obj() will initialize your manadv_xxx structs based on the type you supply. like, you tell it what you want and it delivers 🫢

and where does it get the info for this little makeover? from the ibv_xx structs you supply as part of the input. that's the whole vibe. nothing invented, nothing extra β€” it just takes what you gave it and slays it into mana form ✨


πŸŽ€ ARGUMENTS πŸŽ€

  • obj β€” the manadv_xxx structs to be returned. yes bestie, this is the whole family right here:
struct manadv_qp {
    void        *sq_buf;
    uint32_t    sq_count;
    uint32_t    sq_size;
    uint32_t    sq_id;
    uint32_t    tx_vp_offset;
    void        *db_page;
};

struct manadv_cq {
    void        *buf;
    uint32_t    count;
    uint32_t    cq_id;
};

struct manadv_rwq {
    void        *buf;
    uint32_t    count;
    uint32_t    size;
    uint32_t    wq_id;
    void        *db_page;
};

struct manadv_obj {
    struct {
        struct ibv_qp       *in;
        struct manadv_qp    *out;
    } qp;

    struct {
        struct ibv_cq       *in;
        struct manadv_cq    *out;
    } cq;

    struct {
        struct ibv_wq       *in;
        struct manadv_rwq   *out;
    } rwq;
};

like, look at it. in goes in, out comes out. main character energy for real πŸ”₯

  • obj_type β€” the types of the manadv_xxx structs to be returned. it's a bitmask situation, so you can stack 'em πŸ‘‘
enum manadv_obj_type {
    MANADV_OBJ_QP   = 1 << 0,
    MANADV_OBJ_CQ   = 1 << 1,
    MANADV_OBJ_RWQ  = 1 << 2,
};

🌈 RETURN VALUE 🌈

0 on success β€” we love a zero, we celebrate a zero πŸŽ‰

or, plot twist, the value of errno on failure (which indicates the failure reason). so yeah, if it's not 0, something's giving "problem" and errno is the one to ask about it πŸ’€


πŸ‘‘ AUTHORS πŸ‘‘

Long Li <longli@microsoft.com> β€” thank you for your service, icon 🫢


okay that's the whole page, no cap. this little cutie is manadv_init_obj(3) β€” that's the manual name and like, also literally what's stamped on the footer, same thing top and bottom, iconic consistency honestly πŸ’œβœ¨

πŸ“¦ where this page comes from