IBV_QUERY_GID_EX(3)
π IBV_QUERY_GID_EX(3) β like, the Libibverbs Programmer's Manual one π
okay bestie, so this is a page straight out of the Libibverbs Programmer's Manual and it's about peeking at a GID table entry. it's giving "small function, big energy" and honestly? we're obsessed. let's get into it β¨
πΈ NAME πΈ
ibv_query_gid_ex β go query a GID table entry on an InfiniBand port, bestie. that's the whole vibe π¦
β SYNOPSIS β
#include <infiniband/verbs.h>
int ibv_query_gid_ex(struct ibv_context *context,
uint32_t port_num,
uint32_t gid_index,
struct ibv_gid_entry *entry,
uint32_t flags);
look at that signature. so clean. so iconic. π
π DESCRIPTION π
so ibv_query_gid_ex() literally just returns the GID entry at entry for gid_index of port port_num for device context context. that's it. that's the function. no cap. π«Ά
π ARGUMENTS π
contextβ the context of the device you're querying. your device's whole identity, basically main character energy πport_numβ the number of the port whose GID table you wanna dig through πgid_indexβ the index of the GID table entry you're asking about. like a little locker number, but for GIDs π
π the entry Argument π
this one's an ibv_gid_entry struct, and it's defined right there in <infiniband/verbs.h> for you:
struct ibv_gid_entry {
union ibv_gid gid;
uint32_t gid_index;
uint32_t port_num;
uint32_t gid_type;
uint32_t ndev_ifindex;
};
and here's what each field is serving β¨:
gidβ the GID entry itself. the moment. the star of the show βgid_indexβ the GID table index of this entry πport_numβ the port number that this GID belongs to πͺgid_typeβ anenum ibv_gid_type, and it can be one ofIBV_GID_TYPE_IB,IBV_GID_TYPE_ROCE_V1orIBV_GID_TYPE_ROCE_V2. pick your fighter πndev_ifindexβ the interface index of the net device associated with this GID. it's0if there's no net device associated with it π§flagsβ extra fields to query postndev_ifindex, and for now it must be 0. periodt. don't try to be cute with it π
π¦ RETURN VALUE π¦
ibv_query_gid_ex() returns 0 on success, or an errno value on error. that's the whole deal, lowkey simple π
π ERRORS π
ENODATAβ gid_index is within the GID table size of port port_num but there's literally no data in this index. the locker exists, it's just empty π
π₯ SEE ALSO π₯
ibv_open_device(3), ibv_query_device(3), ibv_query_pkey(3), ibv_query_port(3), ibv_query_gid_table(3)
go read those next, iykyk πβ¨
π AUTHOR π
Parav Pandit <parav@nvidia.com> β thank you for this one, fr fr π«Ά
and that's the page!! this beauty is from libibverbs, dated 2020-04-24, and it ate, no crumbs. mwah π πΈ
π¦ where this page comes from
- alpine 3.24: rdma-core-doc 61.0-r0 Β· GPL-2.0-only OR BSD-2-Clause
- centos-stream 10: rdma-core-devel 62.0-3.el10 Β· GPLv2 or BSD
- centos-stream 9: rdma-core-devel 61.0-3.el9 Β· GPLv2 or BSD
- centos-stream 9: rdma-core-devel 61.0-3.el9 Β· GPLv2 or BSD
- ubuntu jammy: libibverbs-dev 39.0-1 Β· BSD-MIT OR GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms