ibv_get_device_list, ibv_free_device_list

Gets and releases the list of available RDMA devices.

Syntax

#include <rdma/verbs.h>
struct ibv_device **ibv_get_device_list(int *num_devices);
void ibv_free_device_list(struct ibv_device **list);

Description

ibv_get_device_list() returns a NULL-terminated array of RDMA devices currently available. The argument num_devices is optional and if it is NULL, it is set to the number of devices returned in the array.

ibv_free_device_list() frees the array of devices list returned by ibv_get_device_list().

Note: Client code must open all the devices it intends to use with ibv_open_device() before calling ibv_free_device_list(). Once the ibv_free_device_list() function frees the array, The system will be able to use only the open devices and the pointers to unopened devices will no longer be valid.

Output Parameters

num_devices (Optional) If not null, the number of devices returned in the array will be stored here.

Return Value

ibv_get_device_list() returns the array of available RDMA devices, or NULL if the request fails.

ibv_free_device_list() returns no value.

[ Feedback ]