1IBV_ALLOC_MW(3) Libibverbs Programmer's Manual IBV_ALLOC_MW(3)
2
3
4
6 ibv_alloc_mw, ibv_dealloc_mw - allocate or deallocate a memory window
7 (MW)
8
10 #include <infiniband/verbs.h>
11
12 struct ibv_mw *ibv_alloc_mw(struct ibv_pd *pd,
13 enum ibv_mw_type type);
14
15 int ibv_dealloc_mw(struct ibv_mw *mw);
16
18 ibv_alloc_mw() allocates a memory window (MW) associated with the pro‐
19 tection domain pd. The MW's type (1 or 2A/2B) is type.
20
21 The MW is created not bound. For it to be useful, the MW must be bound,
22 through either ibv_bind_mw (type 1) or a special WR (type 2). Once
23 bound, the memory window allows RDMA (remote) access to a subset of the
24 MR to which it was bound, until invalidated by: ibv_bind_mw verb with
25 zero length for type 1, IBV_WR_LOCAL_INV/IBV_WR_SEND_WITH_INV WR opcode
26 for type 2, deallocation.
27
28 ibv_dealloc_mw() Unbinds in case was previously bound and deallocates
29 the MW mw.
30
32 ibv_alloc_mw() returns a pointer to the allocated MW, or NULL if the
33 request fails. The remote key (R_Key) field rkey is used by remote
34 processes to perform Atomic and RDMA operations. This key will be
35 changed during bind operations. The remote process places this rkey as
36 the rkey field of struct ibv_send_wr passed to the ibv_post_send func‐
37 tion.
38
39 ibv_dealloc_mw() returns 0 on success, or the value of errno on failure
40 (which indicates the failure reason).
41
43 ibv_dereg_mr() fails if any memory window is still bound to this MR.
44
46 ibv_alloc_pd(3), ibv_post_send(3), ibv_bind_mw(3), ibv_reg_mr(3),
47
49 Majd Dibbiny <majd@mellanox.com>
50
51 Yishai Hadas <yishaih@mellanox.com>
52
53
54
55libibverbs 2016-02-02 IBV_ALLOC_MW(3)