ibv_open_device, ibv_close_device
Opens and closes an remote device memory access (RDMA) device context.
Syntax
#include <rdma/verbs.h>
struct ibv_context *ibv_open_device(struct ibv_device *device);
int ibv_close_device(struct ibv_context *context);
Description
The ibv_open_device() function opens the devicedevice, and creates a context for further use.
The ibv_close_device() function closes the device contextcontext.
Note: The ibv_close_device() function
does not release all the resources that are allocated by using the
parameter context. To avoid resource leaks, you must release
all the associated resources before closing a context.
Parameter
Item | Description |
---|---|
devices | Specifies the struct ibv_device for the required device. |
Return Value
The ibv_open_deviceand ibv_close_device functions return a verb context that can be used for future operations on the device on successful completion. The function returns NULL if the device is NULL, or if the open operation fails.