ibv_query_gid_table - Man Page

query an InfiniBand device’s GID table


#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);


ibv_query_gid_table() returns the valid GID table entries of the RDMA device context context at the pointer entries.

A caller must allocate entries array for the GID table entries it desires to query. This API returns only valid GID table entries.

A caller must pass non zero number of entries at max_entries that corresponds to the size of entries array.

entries array must be allocated such that 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 entries array, 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.



The context of the device to query.


Array of ibv_gid_entry structs where the GID entries are returned. Please see ibv_query_gid_ex(3) man page for ibv_gid_entry.


Maximum number of entries that can be returned.


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 negative errno value on error. Number of entries returned is <= max_entries.

See Also

ibv_open_device(3), ibv_query_device(3), ibv_query_port(3), ibv_query_gid_ex(3)


Parav Pandit <parav@nvidia.com>

Referenced By


2020-04-24 Libibverbs Programmer’s Manual