1IBV_BIND_MW(3)          Libibverbs Programmer's Manual          IBV_BIND_MW(3)
2
3
4

NAME

6       ibv_bind_mw - post a request to bind a type 1 memory window to a memory
7       region
8

SYNOPSIS

10       #include <infiniband/verbs.h>
11
12       int ibv_bind_mw(struct ibv_qp *qp, struct ibv_mw *mw,
13                       struct ibv_mw_bind *mw_bind);
14

DESCRIPTION

16       ibv_bind_mw() posts to the queue pair qp a request to bind  the  memory
17       window mw according to the details in mw_bind.
18
19       The  argument  mw_bind is an ibv_mw_bind struct, as defined in <infini‐
20       band/verbs.h>.
21
22       struct ibv_mw_bind {
23               uint64_t                     wr_id;           /* User defined WR ID */
24               int                          send_flags;      /* Use ibv_send_flags */
25               struct ibv_mw_bind_info      bind_info;       /* MW bind information */
26       }
27
28       struct ibv_mw_bind_info {
29               struct ibv_mr                *mr;             /* The MR to bind the MW to */
30               uint64_t                     addr;            /* The address the MW should start at */
31               uint64_t                     length;          /* The length (in bytes) the MW should span */
32               int                          mw_access_flags; /* Access flags to the MW. Use ibv_access_flags */
33       };
34
35       The QP Transport Service Type must be either UC,  RC  or  XRC_SEND  for
36       bind operations.
37
38       The  attribute  send_flags  describes  the  properties of the WR. It is
39       either 0 or the bitwise OR of one or more of the following flags:
40
41       IBV_SEND_FENCE  Set the fence indicator.
42
43       IBV_SEND_SIGNALED  Set the completion notification indicator.  Relevant
44       only if QP was created with sq_sig_all=0
45
46       The  mw_access_flags define the allowed access to the MW after the bind
47       completes successfully. It is either 0 or the bitwise OR of one or more
48       of the following flags:
49
50       IBV_ACCESS_REMOTE_WRITE   Enable  Remote  Write  Access. Requires local
51       write access to the MR.
52
53       IBV_ACCESS_REMOTE_READ Enable Remote Read Access
54
55       IBV_ACCESS_REMOTE_ATOMIC Enable Remote Atomic Operation Access (if sup‐
56       ported). Requires local write access to the MR.
57
58       IBV_ACCESS_ZERO_BASED  If  set,  the  address  set on the 'remote_addr'
59       field on the WR will be an offset from the MW's start address.
60

RETURN VALUE

62       ibv_bind_mw() returns 0 on success, or the value of  errno  on  failure
63       (which  indicates the failure reason).  In case of a success, the R_key
64       of  the  memory  window   after   the   bind   is   returned   in   the
65       mw_bind->mw->rkey field.
66

NOTES

68       The  bind  does  not  complete  when the function return - it is merely
69       posted to the QP. The user should keep a copy of the old R_key, and fix
70       the mw structure if the subsequent CQE for the bind operation indicates
71       a failure. The user may safely send the R_key using a send  request  on
72       the  same  QP, (based on QP ordering rules: a send after a bind request
73       on the same QP are always ordered), but must not  transfer  it  to  the
74       remote in any other manner before reading a successful CQE.
75
76       Note  that  for  type 2 MW, one should directly post bind WR to the QP,
77       using ibv_post_send.
78

SEE ALSO

80       ibv_alloc_mw(3), ibv_post_send(3), ibv_poll_cq(3) ibv_reg_mr(3),
81

AUTHORS

83       Majd Dibbiny <majd@mellanox.com>
84
85       Yishai Hadas <yishaih@mellanox.com>
86
87
88
89libibverbs                        2016-02-02                    IBV_BIND_MW(3)
Impressum