IBV_CREATE_AH_FROM_WC(3)

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

πŸ’– IBV_CREATE_AH_FROM_WC πŸ’–

okay bestie, so this is the Libibverbs Programmer's Manual and today we're talking about ibv_init_ah_from_wc and ibv_create_ah_from_wc β€” two lil functions that spin up an address handle (AH) out of a work completion. yes, from a work completion. the way that a whole AH just materializes out of a wc? iconic. πŸ¦‹


✨ NAME ✨

ibv_init_ah_from_wc, ibv_create_ah_from_wc β€” initialize or create an address handle (AH) from a work completion πŸŽ€


✨ SYNOPSIS ✨

#include <infiniband/verbs.h>

int ibv_init_ah_from_wc(struct ibv_context *context, uint8_t port_num,
                        struct ibv_wc *wc, struct ibv_grh *grh,
                        struct ibv_ah_attr *ah_attr);

struct ibv_ah *ibv_create_ah_from_wc(struct ibv_pd *pd,
                                     struct ibv_wc *wc,
                                     struct ibv_grh *grh,
                                     uint8_t port_num);

like, copy that verbatim bestie, don't freestyle the signature πŸ’…


✨ DESCRIPTION ✨

🫢 ibv_init_ah_from_wc()

so this one initializes the address handle (AH) attribute structure ah_attr for the RDMA device context context, using the port number port_num, and it pulls its attributes from the work completion wc plus the Global Routing Header (GRH) structure grh. yes grh, that's the whole vibe. 🌸

🫢 ibv_create_ah_from_wc()

and this one creates an AH that's associated with the protection domain pd, using the port number port_num, again stealing attributes from the work completion wc and the Global Routing Header (GRH) structure grh. same energy, but it actually hands you a whole AH. ate. πŸ‘‘


✨ RETURN VALUE ✨

  • ibv_init_ah_from_wc() returns 0 on success, and -1 on error. no in-between, no crumbs. 😭
  • ibv_create_ah_from_wc() returns a pointer to the created AH, or NULL if the request fails. so like… vibe check the return value, fr fr.

✨ NOTES ✨

the filled structure ah_attr that comes back from ibv_init_ah_from_wc() can be used to create a new AH using ibv_create_ah(). so you init here, you create there. teamwork, lowkey. 🌈

not me reminding you to actually keep that ah_attr around if you're gonna use it β€” it's giving "the whole point". πŸ™ˆ

✨ SEE ALSO ✨

go read those too bestie, iykyk πŸ’œ


✨ AUTHORS ✨

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


libibverbs Β· 2006-10-31 Β· IBV_CREATE_AH_FROM_WC(3)

and that's the page!! dated 2006-10-31, from the libibverbs crew, filed under IBV_CREATE_AH_FROM_WC(3) β€” slay, bye bestie, go build some address handles πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from