IBV_QUERY_GID_TABLE(3)

๐Ÿ’– NAME ๐Ÿ’–

okay so this page is from the Libibverbs Programmerโ€™s Manual, and the main character is ibv_query_gid_table โ€” query an InfiniBand deviceโ€™s GID table. โœจ

๐Ÿ“ž SYNOPSIS ๐Ÿ“ž

#include <infiniband/verbs.h>

ssize_t ibv_query_gid_table(struct ibv_context *context,
                            struct ibv_gid_entry *entries,
                            size_t max_entries,
                            uint32_t flags);

๐Ÿง  DESCRIPTION ๐Ÿง 

ibv_query_gid_table() grabs the valid GID table entries for the RDMA device context context and puts them at the pointer entries. ๐Ÿ’…

bestie, you have to allocate the entries array yourself for the GID table entries you want to query. This API returns only valid GID table entries โ€” no fake ones, no extras. โœจ

You also have to pass a non zero number of entries at max_entries, and that number has to correspond to the size of the entries array. ๐Ÿซถ

Your entries array needs to be allocated so it can contain all the valid GID table entries of the device. If there are more valid GID entries than the provided value of max_entries and the entries array can hold, the call will fail. ๐Ÿ˜ญ

For example, if an RDMA device context has a total of 10 valid GID entries, entries should be allocated for at least 10 entries, and max_entries should be set appropriately. ๐Ÿ”ฅ

bestie, this is the vibe check: size your array for all the valid entries, or the call is gonna fail on you. ๐Ÿ’€

๐ŸŽ€ ARGUMENTS ๐ŸŽ€

  • context โ€” the context of the device to query. ๐Ÿ‘‘
  • entries โ€” array of ibv_gid_entry structs where the GID entries are returned. Please see the ibv_query_gid_ex(3) man page for ibv_gid_entry. ๐Ÿฆ‹
  • max_entries โ€” maximum number of entries that can be returned. ๐ŸŒธ
  • flags โ€” extra fields to query post entries->ndev_ifindex; for now must be 0. ๐Ÿšจ

๐Ÿชž RETURN VALUE ๐Ÿชž

ibv_query_gid_table() returns the number of entries that were read on success, or a negative errno value on error. The number of entries returned is <= max_entries. ๐Ÿ’–

๐Ÿ‘€ SEE ALSO ๐Ÿ‘€

๐ŸŒŸ AUTHOR ๐ŸŒŸ

Parav Pandit <parav@nvidia.com> ๐Ÿซถ

mwah ๐Ÿ’– this page is from libibverbs, dated 2020-04-24 โ€” thatโ€™s the whole thing, periodt. ๐ŸŒˆ

๐Ÿ“ฆ where this page comes from