]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/ofed/libibverbs/man/ibv_post_send.3
THIS BRANCH IS OBSOLETE, PLEASE READ:
[FreeBSD/FreeBSD.git] / contrib / ofed / libibverbs / man / ibv_post_send.3
1 .\" -*- nroff -*-
2 .\" Licensed under the OpenIB.org BSD license (FreeBSD Variant) - See COPYING.md
3 .\"
4 .TH IBV_POST_SEND 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual"
5 .SH "NAME"
6 ibv_post_send \- post a list of work requests (WRs) to a send queue
7 .SH "SYNOPSIS"
8 .nf
9 .B #include <infiniband/verbs.h>
10 .sp
11 .BI "int ibv_post_send(struct ibv_qp " "*qp" ", struct ibv_send_wr " "*wr" ,
12 .BI "                  struct ibv_send_wr " "**bad_wr" );
13 .fi
14 .SH "DESCRIPTION"
15 .B ibv_post_send()
16 posts the linked list of work requests (WRs) starting with
17 .I wr
18 to the send queue of the queue pair
19 .I qp\fR.
20 It stops processing WRs from this list at the first failure (that can
21 be detected immediately while requests are being posted), and returns
22 this failing WR through
23 .I bad_wr\fR.
24 .PP
25 The argument
26 .I wr
27 is an ibv_send_wr struct, as defined in <infiniband/verbs.h>.
28 .PP
29 .nf
30 struct ibv_send_wr {
31 .in +8
32 uint64_t                wr_id;                  /* User defined WR ID */
33 struct ibv_send_wr     *next;                   /* Pointer to next WR in list, NULL if last WR */
34 struct ibv_sge         *sg_list;                /* Pointer to the s/g array */
35 int                     num_sge;                /* Size of the s/g array */
36 enum ibv_wr_opcode      opcode;                 /* Operation type */
37 int                     send_flags;             /* Flags of the WR properties */
38 uint32_t                imm_data;               /* Immediate data (in network byte order) */
39 union {
40 .in +8
41 struct {
42 .in +8
43 uint64_t        remote_addr;    /* Start address of remote memory buffer */
44 uint32_t        rkey;           /* Key of the remote Memory Region */
45 .in -8
46 } rdma;
47 struct {
48 .in +8
49 uint64_t        remote_addr;    /* Start address of remote memory buffer */ 
50 uint64_t        compare_add;    /* Compare operand */
51 uint64_t        swap;           /* Swap operand */
52 uint32_t        rkey;           /* Key of the remote Memory Region */
53 .in -8
54 } atomic;
55 struct {
56 .in +8
57 struct ibv_ah  *ah;             /* Address handle (AH) for the remote node address */
58 uint32_t        remote_qpn;     /* QP number of the destination QP */
59 uint32_t        remote_qkey;    /* Q_Key number of the destination QP */
60 .in -8
61 } ud;
62 .in -8
63 } wr;
64 union {
65 .in +8
66 struct {
67 .in +8
68 uint32_t remote_srqn;            /* Number of the remote SRQ */
69 .in -8
70 } xrc;
71 .in -8
72 } qp_type;
73 union {
74 .in +8
75 struct {
76 .in +8
77 struct ibv_mw            *mw;             /* Memory window (MW) of type 2 to bind */
78 uint32_t                 rkey;            /* The desired new rkey of the MW */
79 struct ibv_mw_bind_info  bind_info;       /* MW additional bind information */
80 .in -8
81 } bind_mw;
82 struct {
83 .in +8
84 void                    *hdr;   /* Pointer address of inline header */
85 uint16_t                hdr_sz; /* Inline header size */
86 uint16_t                mss;    /* Maximum segment size for each TSO fragment */
87 .in -8
88 } tso;
89 .in -8
90 };
91 .in -8
92 };
93 .fi
94 .sp
95 .nf
96 struct ibv_mw_bind_info {
97 .in +8
98 struct ibv_mr            *mr;             /* The Memory region (MR) to bind the MW to */
99 uint64_t                 addr;           /* The address the MW should start at */
100 uint64_t                 length;          /* The length (in bytes) the MW should span */
101 int                      mw_access_flags; /* Access flags to the MW. Use ibv_access_flags */
102 .in -8
103 };
104 .fi
105 .sp
106 .nf
107 struct ibv_sge {
108 .in +8
109 uint64_t                addr;                   /* Start address of the local memory buffer */
110 uint32_t                length;                 /* Length of the buffer */
111 uint32_t                lkey;                   /* Key of the local Memory Region */
112 .in -8
113 };
114 .fi
115 .PP
116 Each QP Transport Service Type supports a specific set of opcodes, as shown in the following table:
117 .PP
118 .nf
119 OPCODE                      | IBV_QPT_UD | IBV_QPT_UC | IBV_QPT_RC | IBV_QPT_XRC_SEND | IBV_QPT_RAW_PACKET
120 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
121 IBV_WR_SEND                 |     X      |     X      |     X      |         X        |         X
122 IBV_WR_SEND_WITH_IMM        |     X      |     X      |     X      |         X        |
123 IBV_WR_RDMA_WRITE           |            |     X      |     X      |         X        |
124 IBV_WR_RDMA_WRITE_WITH_IMM  |            |     X      |     X      |         X        |
125 IBV_WR_RDMA_READ            |            |            |     X      |         X        |
126 IBV_WR_ATOMIC_CMP_AND_SWP   |            |            |     X      |         X        |
127 IBV_WR_ATOMIC_FETCH_AND_ADD |            |            |     X      |         X        |
128 IBV_WR_LOCAL_INV            |            |     X      |     X      |         X        |
129 IBV_WR_BIND_MW              |            |     X      |     X      |         X        |
130 IBV_WR_SEND_WITH_INV        |            |     X      |     X      |         X        |
131 IBV_WR_TSO                  |     X      |            |            |                  |         X
132 .fi
133 .PP
134 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:
135 .PP
136 .TP
137 .B IBV_SEND_FENCE \fR Set the fence indicator.  Valid only for QPs with Transport Service Type \fBIBV_QPT_RC
138 .TP
139 .B IBV_SEND_SIGNALED \fR Set the completion notification indicator.  Relevant only if QP was created with sq_sig_all=0
140 .TP
141 .B IBV_SEND_SOLICITED \fR Set the solicited event indicator.  Valid only for Send and RDMA Write with immediate
142 .TP
143 .B IBV_SEND_INLINE \fR Send data in given gather list as inline data
144 in a send WQE.  Valid only for Send and RDMA Write.  The L_Key will not be checked.
145 .TP
146 .B IBV_SEND_IP_CSUM \fR Offload the IPv4 and TCP/UDP checksum calculation.
147 Valid only when \fBdevice_cap_flags\fR in device_attr indicates current QP is
148 supported by checksum offload.
149 .SH "RETURN VALUE"
150 .B ibv_post_send()
151 returns 0 on success, or the value of errno on failure (which indicates the failure reason).
152 .SH "NOTES"
153 The user should not alter or destroy AHs associated with WRs until
154 request is fully executed and a work completion has been retrieved
155 from the corresponding completion queue (CQ) to avoid unexpected
156 behavior.
157 .PP
158 The buffers used by a WR can only be safely reused after WR the
159 request is fully executed and a work completion has been retrieved
160 from the corresponding completion queue (CQ). However, if the
161 IBV_SEND_INLINE flag was set, the buffer can be reused immediately
162 after the call returns.
163 .SH "SEE ALSO"
164 .BR ibv_create_qp (3),
165 .BR ibv_create_ah (3),
166 .BR ibv_post_recv (3),
167 .BR ibv_post_srq_recv (3),
168 .BR ibv_poll_cq (3)
169 .SH "AUTHORS"
170 .TP
171 Dotan Barak <dotanba@gmail.com>
172 .TP
173 Majd Dibbiny <majd@mellanox.com>
174 .TP
175 Yishai Hadas <yishaih@mellanox.com>