| 1 | --- |
| 2 | date: 2020-04-24 |
| 3 | footer: libibverbs |
| 4 | header: "Libibverbs Programmer's Manual" |
| 5 | layout: page |
| 6 | license: 'Licensed under the OpenIB.org BSD license (FreeBSD Variant) - See COPYING.md' |
| 7 | section: 3 |
| 8 | title: IBV_QUERY_GID_TABLE |
| 9 | --- |
| 10 | |
| 11 | # NAME |
| 12 | |
| 13 | ibv_query_gid_table - query an InfiniBand device's GID table |
| 14 | |
| 15 | # SYNOPSIS |
| 16 | |
| 17 | ```c |
| 18 | #include <infiniband/verbs.h> |
| 19 | |
| 20 | ssize_t ibv_query_gid_table(struct ibv_context *context, |
| 21 | struct ibv_gid_entry *entries, |
| 22 | size_t max_entries, |
| 23 | uint32_t flags); |
| 24 | ``` |
| 25 | |
| 26 | # DESCRIPTION |
| 27 | |
| 28 | **ibv_query_gid_table()** returns the valid GID table entries of the RDMA |
| 29 | device context *context* at the pointer *entries*. |
| 30 | |
| 31 | A caller must allocate *entries* array for the GID table entries it |
| 32 | desires to query. This API returns only valid GID table entries. |
| 33 | |
| 34 | A caller must pass non zero number of entries at *max_entries* that corresponds |
| 35 | to the size of *entries* array. |
| 36 | |
| 37 | *entries* array must be allocated such that it can contain all the valid |
| 38 | GID table entries of the device. If there are more valid GID entries than |
| 39 | the provided value of *max_entries* and *entries* array, the call will fail. |
| 40 | For example, if an RDMA device *context* has a total of 10 valid |
| 41 | GID entries, *entries* should be allocated for at least 10 entries, and |
| 42 | *max_entries* should be set appropriately. |
| 43 | |
| 44 | # ARGUMENTS |
| 45 | |
| 46 | *context* |
| 47 | : The context of the device to query. |
| 48 | |
| 49 | *entries* |
| 50 | : Array of ibv_gid_entry structs where the GID entries are returned. |
| 51 | Please see **ibv_query_gid_ex**(3) man page for *ibv_gid_entry*. |
| 52 | |
| 53 | *max_entries* |
| 54 | : Maximum number of entries that can be returned. |
| 55 | |
| 56 | *flags* |
| 57 | : Extra fields to query post *entries->ndev_ifindex*, for now must be 0. |
| 58 | |
| 59 | # RETURN VALUE |
| 60 | |
| 61 | **ibv_query_gid_table()** returns the number of entries that were read on success or negative errno value on error. |
| 62 | Number of entries returned is <= max_entries. |
| 63 | |
| 64 | # SEE ALSO |
| 65 | |
| 66 | **ibv_open_device**(3), |
| 67 | **ibv_query_device**(3), |
| 68 | **ibv_query_port**(3), |
| 69 | **ibv_query_gid_ex**(3) |
| 70 | |
| 71 | # AUTHOR |
| 72 | |
| 73 | Parav Pandit <[email protected]> |