IBV_QUERY_PKEY(3)

πŸ’… ibv_query_pkey β€” like, the InfiniBand port P_Key table lookup bestie

okay so this is a page from the Libibverbs Programmer's Manual, and it's literally about peeking at one single entry in an InfiniBand port's P_Key table. tiny function, big main character energy. πŸŽ€


✨ NAME ✨

ibv_query_pkey β€” query an InfiniBand port's P_Key table πŸ¦‹

like… you want one P_Key? this is the girl who gets you that P_Key.


🌸 SYNOPSIS 🌸

#include <infiniband/verbs.h>

int ibv_query_pkey(struct ibv_context *context,
                   uint8_t port_num,
                   int index,
                   uint16_t *pkey);

no cap, that's the whole vibe. four args, one int coming back at you. ✨


πŸ’– DESCRIPTION πŸ’–

ibv_query_pkey() hands you back the P_Key value for the device context context, on port port_num, at the entry called index β€” and it writes it out through the pointer pkey. 🫢

and bestie, important detail: the P_Key value comes back in network byte order. not host byte order. network. byte. order. write that on your mirror fr fr πŸ’…

so like, context = which device, port_num = which port, index = which entry in that port's P_Key table, pkey = where the answer lands. one entry, one answer, iconic behaviour only. πŸ‘‘


⭐ RETURN VALUE ⭐

  • 0 β€” slay, it worked ✨ success bestie
  • -1 β€” nope, error 😭 that's the whole deal

πŸ¦‹ SEE ALSO πŸ¦‹

the friend group, all of them holding hands:


🌈 AUTHOR 🌈

Dotan Barak <dotanba@gmail.com> β€” respectfully, legend behaviour πŸ’œ


🧚 little reminder before you go: index picks the entry, pkey takes the value, and that value is in network byte order. do not come for me later if you forget. πŸ™ˆ

and that's the whole page, gorgeous. brought to you by libibverbs, dated 2006-10-31 β€” yeah she's vintage but she still ate πŸ’…πŸŽ€

πŸ“¦ where this page comes from