| 1 |
.\" -*- nroff -*- |
| 2 |
.\" Licensed under the OpenIB.org BSD license (FreeBSD Variant) - See COPYING.md |
| 3 |
.\" |
| 4 |
.TH IBV_ALLOC_TD 3 2017-11-06 libibverbs "Libibverbs Programmer's Manual" |
| 5 |
.SH "NAME" |
| 6 |
ibv_alloc_td(), ibv_dealloc_td() \- allocate and deallocate thread domain object |
| 7 |
.SH "SYNOPSIS" |
| 8 |
.nf |
| 9 |
.B #include <infiniband/verbs.h> |
| 10 |
.sp |
| 11 |
.BI "struct ibv_td *ibv_alloc_td(struct ibv_context " "*context" , |
| 12 |
.BI " struct ibv_td_init_attr " "*init_attr" ); |
| 13 |
.sp |
| 14 |
.BI "int ibv_dealloc_td(struct ibv_td " "*td"); |
| 15 |
.fi |
| 16 |
.SH "DESCRIPTION" |
| 17 |
.B ibv_alloc_td() |
| 18 |
allocates a thread domain object for the RDMA device context |
| 19 |
.I context\fR. |
| 20 |
.sp |
| 21 |
The thread domain object defines how the verbs libraries and provider will use |
| 22 |
locks and additional hardware capabilities to achieve best performance for |
| 23 |
handling multi-thread or single-thread protection. An application assigns |
| 24 |
verbs resources to a thread domain when it creates a verbs object. |
| 25 |
.sp |
| 26 |
If the |
| 27 |
.I |
| 28 |
ibv_td |
| 29 |
object is specified then any objects created under this thread domain will |
| 30 |
disable internal locking designed to protect against concurrent access to that |
| 31 |
object from multiple user threads. By default all verbs objects are safe for |
| 32 |
multi-threaded access, whether or not a thread domain is specified. |
| 33 |
.sp |
| 34 |
A |
| 35 |
.I struct ibv_td |
| 36 |
can be added to a parent domain via |
| 37 |
.B ibv_alloc_parent_domain() |
| 38 |
and then the parent domain can be used to create verbs objects. |
| 39 |
.sp |
| 40 |
.B ibv_dealloc_td() |
| 41 |
will deallocate the thread domain |
| 42 |
.I td\fR. |
| 43 |
All resources created with the |
| 44 |
.I td |
| 45 |
should be destroyed prior to deallocating the |
| 46 |
.I td\fR. |
| 47 |
.SH "RETURN VALUE" |
| 48 |
.B ibv_alloc_td() |
| 49 |
returns a pointer to the allocated struct |
| 50 |
.I ibv_td |
| 51 |
object, or NULL if the request fails (and sets errno to indicate the failure reason). |
| 52 |
.sp |
| 53 |
.B ibv_dealloc_td() |
| 54 |
returns 0 on success, or the value of errno on failure (which indicates the failure reason). |
| 55 |
.SH "SEE ALSO" |
| 56 |
.BR ibv_alloc_parent_domain (3), |
| 57 |
.SH "AUTHORS" |
| 58 |
.TP |
| 59 |
Alex Rosenbaum <[email protected]> |
| 60 |
.TP |
| 61 |
Yishai Hadas <[email protected]> |