| 1 |
.\" -*- nroff -*- |
| 2 |
.\" Licensed under the OpenIB.org BSD license (FreeBSD Variant) - See COPYING.md |
| 3 |
.\" |
| 4 |
.TH IBV_OPEN_DEVICE 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual" |
| 5 |
.SH "NAME" |
| 6 |
ibv_open_device, ibv_close_device \- open and close an RDMA device context |
| 7 |
.SH "SYNOPSIS" |
| 8 |
.nf |
| 9 |
.B #include <infiniband/verbs.h> |
| 10 |
.sp |
| 11 |
.BI "struct ibv_context *ibv_open_device(struct ibv_device " "*device" "); |
| 12 |
.sp |
| 13 |
.BI "int ibv_close_device(struct ibv_context " "*context" "); |
| 14 |
.fi |
| 15 |
.SH "DESCRIPTION" |
| 16 |
.B ibv_open_device() |
| 17 |
opens the device |
| 18 |
.I device |
| 19 |
and creates a context for further use. |
| 20 |
.PP |
| 21 |
.B ibv_close_device() |
| 22 |
closes the device context |
| 23 |
.I context\fR. |
| 24 |
.SH "RETURN VALUE" |
| 25 |
.B ibv_open_device() |
| 26 |
returns a pointer to the allocated device context, or NULL if the request fails. |
| 27 |
.PP |
| 28 |
.B ibv_close_device() |
| 29 |
returns 0 on success, \-1 on failure. |
| 30 |
.SH "NOTES" |
| 31 |
.B ibv_close_device() |
| 32 |
does not release all the resources allocated using context |
| 33 |
.I context\fR. |
| 34 |
To avoid resource leaks, the user should release all associated |
| 35 |
resources before closing a context. |
| 36 |
|
| 37 |
Setting the environment variable **RDMAV_ALLOW_DISASSOC_DESTROY** tells the |
| 38 |
library to relate an EIO from destroy commands as a success as the kernel |
| 39 |
resources were already released. This comes to prevent memory leakage in the |
| 40 |
user space area upon device disassociation. Applications using this flag cannot |
| 41 |
call ibv_get_cq_event or ibv_get_async_event concurrently with any call to an |
| 42 |
object destruction function. |
| 43 |
|
| 44 |
.SH "SEE ALSO" |
| 45 |
.BR ibv_get_device_list (3), |
| 46 |
.BR ibv_query_device (3), |
| 47 |
.BR ibv_query_port (3), |
| 48 |
.BR ibv_query_gid (3), |
| 49 |
.BR ibv_query_pkey (3) |
| 50 |
.SH "AUTHORS" |
| 51 |
.TP |
| 52 |
Dotan Barak <[email protected]> |