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