Debian Codegraph @

libibverbs/man/ibv_bind_mw.3

raw
1 .\" -*- nroff -*-
2 .\" Licensed under the OpenIB.org BSD license (FreeBSD Variant) - See COPYING.md
3 .\"
4 .TH IBV_BIND_MW 3 2016-02-02 libibverbs "Libibverbs Programmer's Manual"
5 .SH "NAME"
6 ibv_bind_mw \- post a request to bind a type 1 memory window to a memory region
7 .SH "SYNOPSIS"
8 .nf
9 .B #include <infiniband/verbs.h>
10 .sp
11 .BI "int ibv_bind_mw(struct ibv_qp " "*qp" ", struct ibv_mw " "*mw" ",
12 .BI " struct ibv_mw_bind " "*mw_bind" ");
13 .fi
14 .SH "DESCRIPTION"
15 .B ibv_bind_mw()
16 posts to the queue pair
17 .I qp
18 a request to bind the memory window
19 .I mw
20 according to the details in
21 .I mw_bind\fR.
22 .PP
23 The argument
24 .I mw_bind
25 is an ibv_mw_bind struct, as defined in <infiniband/verbs.h>.
26 .PP
27 .nf
28 struct ibv_mw_bind {
29 .in +8
30 uint64_t wr_id; /* User defined WR ID */
31 unsigned int send_flags; /* Use ibv_send_flags */
32 struct ibv_mw_bind_info bind_info; /* MW bind information */
33 .in -8
34 }
35 .fi
36 .PP
37 .nf
38 struct ibv_mw_bind_info {
39 .in +8
40 struct ibv_mr *mr; /* The MR to bind the MW to */
41 uint64_t addr; /* The address the MW should start at */
42 uint64_t length; /* The length (in bytes) the MW should span */
43 unsigned int mw_access_flags; /* Access flags to the MW. Use ibv_access_flags */
44 .in -8
45 };
46 .fi
47 .PP
48 The QP Transport Service Type must be either UC, RC or XRC_SEND for bind operations.
49 .PP
50 The attribute send_flags describes the properties of the \s-1WR\s0. It is either 0 or the bitwise \s-1OR\s0 of one or more of the following flags:
51 .PP
52 .TP
53 .B IBV_SEND_FENCE \fR Set the fence indicator.
54 .TP
55 .B IBV_SEND_SIGNALED \fR Set the completion notification indicator. Relevant only if QP was created with sq_sig_all=0
56 .PP
57 The mw_access_flags define the allowed access to the MW after the bind
58 completes successfully. It is either 0 or the bitwise \s-1OR\s0 of one
59 or more of the following flags:
60 .TP
61 .B IBV_ACCESS_REMOTE_WRITE \fR Enable Remote Write Access. Requires local write access to the MR.
62 .TP
63 .B IBV_ACCESS_REMOTE_READ\fR Enable Remote Read Access
64 .TP
65 .B IBV_ACCESS_REMOTE_ATOMIC\fR Enable Remote Atomic Operation Access (if supported). Requires local write access to the MR.
66 .TP
67 .B IBV_ACCESS_ZERO_BASED\fR If set, the address set on the 'remote_addr' field on the WR will be an offset from the MW's start address.
68 .SH "RETURN VALUE"
69 .B ibv_bind_mw()
70 returns 0 on success, or the value of errno on failure (which
71 indicates the failure reason). In case of a success, the R_key of the
72 memory window after the bind is returned in the mw_bind->mw->rkey field.
73 .SH "NOTES"
74 The bind does not complete when the function return - it is merely
75 posted to the QP. The user should keep a copy of the old R_key, and
76 fix the mw structure if the subsequent CQE for the bind operation
77 indicates a failure. The user may safely send the R_key using a send
78 request on the same QP, (based on QP ordering rules: a send after a bind
79 request on the same QP are always ordered), but must not transfer it to the
80 remote in any other manner before reading a successful CQE.
81 .PP
82 Note that for type 2 MW, one should directly post bind WR to the QP,
83 using ibv_post_send.
84 .SH "SEE ALSO"
85 .BR ibv_alloc_mw (3),
86 .BR ibv_post_send (3),
87 .BR ibv_poll_cq (3)
88 .BR ibv_reg_mr (3),
89 .SH "AUTHORS"
90 .TP
91 Majd Dibbiny <[email protected]>
92 .TP
93 Yishai Hadas <[email protected]>