| 1 |
.\" -*- nroff -*- |
| 2 |
.\" Licensed under the OpenIB.org BSD license (FreeBSD Variant) - See COPYING.md |
| 3 |
.\" |
| 4 |
.TH IBV_ALLOC_MW 3 2016-02-02 libibverbs "Libibverbs Programmer's Manual" |
| 5 |
.SH "NAME" |
| 6 |
ibv_alloc_mw, ibv_dealloc_mw \- allocate or deallocate a memory window (MW) |
| 7 |
.SH "SYNOPSIS" |
| 8 |
.nf |
| 9 |
.B #include <infiniband/verbs.h> |
| 10 |
.sp |
| 11 |
.BI "struct ibv_mw *ibv_alloc_mw(struct ibv_pd " "*pd" , |
| 12 |
.BI " enum ibv_mw_type " "type"); |
| 13 |
.sp |
| 14 |
.BI "int ibv_dealloc_mw(struct ibv_mw " "*mw" ); |
| 15 |
.fi |
| 16 |
.SH "DESCRIPTION" |
| 17 |
.B ibv_alloc_mw() |
| 18 |
allocates a memory window (MW) associated with the protection domain |
| 19 |
.I pd\fR. |
| 20 |
The MW's type (1 or 2A/2B) is |
| 21 |
.I type\fR. |
| 22 |
.PP |
| 23 |
The MW is created not bound. For it to be useful, the MW must be bound, through either ibv_bind_mw (type 1) or a special WR (type 2). |
| 24 |
Once bound, the memory window allows RDMA (remote) access to a subset of the MR to which it was bound, |
| 25 |
until invalidated by: ibv_bind_mw verb with zero length for type 1, |
| 26 |
IBV_WR_LOCAL_INV/IBV_WR_SEND_WITH_INV WR opcode for type 2, deallocation. |
| 27 |
.PP |
| 28 |
.B ibv_dealloc_mw() |
| 29 |
Unbinds in case was previously bound and deallocates the MW |
| 30 |
.I mw\fR. |
| 31 |
.SH "RETURN VALUE" |
| 32 |
.B ibv_alloc_mw() |
| 33 |
returns a pointer to the allocated MW, or NULL if the request fails. |
| 34 |
The remote key (\fBR_Key\fR) |
| 35 |
field |
| 36 |
.B rkey |
| 37 |
is used by remote processes to perform Atomic and RDMA operations. This key will be changed during bind operations. The remote process places this |
| 38 |
.B rkey |
| 39 |
as the rkey field of struct ibv_send_wr passed to the ibv_post_send function. |
| 40 |
.PP |
| 41 |
.B ibv_dealloc_mw() |
| 42 |
returns 0 on success, or the value of errno on failure (which indicates the failure reason). |
| 43 |
.SH "NOTES" |
| 44 |
.B ibv_dereg_mr() |
| 45 |
fails if any memory window is still bound to this MR. |
| 46 |
.SH "SEE ALSO" |
| 47 |
.BR ibv_alloc_pd (3), |
| 48 |
.BR ibv_post_send (3), |
| 49 |
.BR ibv_bind_mw (3), |
| 50 |
.BR ibv_reg_mr (3), |
| 51 |
.SH "AUTHORS" |
| 52 |
.TP |
| 53 |
Majd Dibbiny <[email protected]> |
| 54 |
.TP |
| 55 |
Yishai Hadas <[email protected]> |