| 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 |
unsigned int send_flags; /* Flags of the WR properties */ |
| 38 |
union { |
| 39 |
.in +8 |
| 40 |
__be32 imm_data; /* Immediate data (in network byte order) */ |
| 41 |
uint32_t invalidate_rkey; /* Remote rkey to invalidate */ |
| 42 |
.in -8 |
| 43 |
}; |
| 44 |
union { |
| 45 |
.in +8 |
| 46 |
struct { |
| 47 |
.in +8 |
| 48 |
uint64_t remote_addr; /* Start address of remote memory buffer */ |
| 49 |
uint32_t rkey; /* Key of the remote Memory Region */ |
| 50 |
.in -8 |
| 51 |
} rdma; |
| 52 |
struct { |
| 53 |
.in +8 |
| 54 |
uint64_t remote_addr; /* Start address of remote memory buffer */ |
| 55 |
uint64_t compare_add; /* Compare operand */ |
| 56 |
uint64_t swap; /* Swap operand */ |
| 57 |
uint32_t rkey; /* Key of the remote Memory Region */ |
| 58 |
.in -8 |
| 59 |
} atomic; |
| 60 |
struct { |
| 61 |
.in +8 |
| 62 |
struct ibv_ah *ah; /* Address handle (AH) for the remote node address */ |
| 63 |
uint32_t remote_qpn; /* QP number of the destination QP */ |
| 64 |
uint32_t remote_qkey; /* Q_Key number of the destination QP */ |
| 65 |
.in -8 |
| 66 |
} ud; |
| 67 |
.in -8 |
| 68 |
} wr; |
| 69 |
union { |
| 70 |
.in +8 |
| 71 |
struct { |
| 72 |
.in +8 |
| 73 |
uint32_t remote_srqn; /* Number of the remote SRQ */ |
| 74 |
.in -8 |
| 75 |
} xrc; |
| 76 |
.in -8 |
| 77 |
} qp_type; |
| 78 |
union { |
| 79 |
.in +8 |
| 80 |
struct { |
| 81 |
.in +8 |
| 82 |
struct ibv_mw *mw; /* Memory window (MW) of type 2 to bind */ |
| 83 |
uint32_t rkey; /* The desired new rkey of the MW */ |
| 84 |
struct ibv_mw_bind_info bind_info; /* MW additional bind information */ |
| 85 |
.in -8 |
| 86 |
} bind_mw; |
| 87 |
struct { |
| 88 |
.in +8 |
| 89 |
void *hdr; /* Pointer address of inline header */ |
| 90 |
uint16_t hdr_sz; /* Inline header size */ |
| 91 |
uint16_t mss; /* Maximum segment size for each TSO fragment */ |
| 92 |
.in -8 |
| 93 |
} tso; |
| 94 |
.in -8 |
| 95 |
}; |
| 96 |
.in -8 |
| 97 |
}; |
| 98 |
.fi |
| 99 |
.sp |
| 100 |
.nf |
| 101 |
struct ibv_mw_bind_info { |
| 102 |
.in +8 |
| 103 |
struct ibv_mr *mr; /* The Memory region (MR) to bind the MW to */ |
| 104 |
uint64_t addr; /* The address the MW should start at */ |
| 105 |
uint64_t length; /* The length (in bytes) the MW should span */ |
| 106 |
unsigned int mw_access_flags; /* Access flags to the MW. Use ibv_access_flags */ |
| 107 |
.in -8 |
| 108 |
}; |
| 109 |
.fi |
| 110 |
.sp |
| 111 |
.nf |
| 112 |
struct ibv_sge { |
| 113 |
.in +8 |
| 114 |
uint64_t addr; /* Start address of the local memory buffer or number of bytes from the |
| 115 |
start of the MR for MRs which are IBV_ACCESS_ZERO_BASED */ |
| 116 |
uint32_t length; /* Length of the buffer */ |
| 117 |
uint32_t lkey; /* Key of the local Memory Region */ |
| 118 |
.in -8 |
| 119 |
}; |
| 120 |
.fi |
| 121 |
.PP |
| 122 |
Each QP Transport Service Type supports a specific set of opcodes, as shown in the following table: |
| 123 |
.PP |
| 124 |
.nf |
| 125 |
OPCODE | IBV_QPT_UD | IBV_QPT_UC | IBV_QPT_RC | IBV_QPT_XRC_SEND | IBV_QPT_RAW_PACKET |
| 126 |
\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- |
| 127 |
IBV_WR_SEND | X | X | X | X | X |
| 128 |
IBV_WR_SEND_WITH_IMM | X | X | X | X | |
| 129 |
IBV_WR_RDMA_WRITE | | X | X | X | |
| 130 |
IBV_WR_RDMA_WRITE_WITH_IMM | | X | X | X | |
| 131 |
IBV_WR_RDMA_READ | | | X | X | |
| 132 |
IBV_WR_ATOMIC_CMP_AND_SWP | | | X | X | |
| 133 |
IBV_WR_ATOMIC_FETCH_AND_ADD | | | X | X | |
| 134 |
IBV_WR_LOCAL_INV | | X | X | X | |
| 135 |
IBV_WR_BIND_MW | | X | X | X | |
| 136 |
IBV_WR_SEND_WITH_INV | | X | X | X | |
| 137 |
IBV_WR_TSO | X | | | | X |
| 138 |
.fi |
| 139 |
.PP |
| 140 |
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: |
| 141 |
.PP |
| 142 |
.TP |
| 143 |
.B IBV_SEND_FENCE \fR Set the fence indicator. Valid only for QPs with Transport Service Type \fBIBV_QPT_RC |
| 144 |
.TP |
| 145 |
.B IBV_SEND_SIGNALED \fR Set the completion notification indicator. Relevant only if QP was created with sq_sig_all=0 |
| 146 |
.TP |
| 147 |
.B IBV_SEND_SOLICITED \fR Set the solicited event indicator. Valid only for Send and RDMA Write with immediate |
| 148 |
.TP |
| 149 |
.B IBV_SEND_INLINE \fR Send data in given gather list as inline data |
| 150 |
in a send WQE. Valid only for Send and RDMA Write. The L_Key will not be checked. |
| 151 |
.TP |
| 152 |
.B IBV_SEND_IP_CSUM \fR Offload the IPv4 and TCP/UDP checksum calculation. |
| 153 |
Valid only when \fBdevice_cap_flags\fR in device_attr indicates current QP is |
| 154 |
supported by checksum offload. |
| 155 |
.SH "RETURN VALUE" |
| 156 |
.B ibv_post_send() |
| 157 |
returns 0 on success, or the value of errno on failure (which indicates the failure reason). |
| 158 |
.SH "NOTES" |
| 159 |
The user should not alter or destroy AHs associated with WRs until |
| 160 |
request is fully executed and a work completion has been retrieved |
| 161 |
from the corresponding completion queue (CQ) to avoid unexpected |
| 162 |
behavior. |
| 163 |
.PP |
| 164 |
The buffers used by a WR can only be safely reused after WR the |
| 165 |
request is fully executed and a work completion has been retrieved |
| 166 |
from the corresponding completion queue (CQ). However, if the |
| 167 |
IBV_SEND_INLINE flag was set, the buffer can be reused immediately |
| 168 |
after the call returns. |
| 169 |
.PP |
| 170 |
IBV_WR_DRIVER1 is an opcode that should be used to issue a specific driver operation. |
| 171 |
.SH "SEE ALSO" |
| 172 |
.BR ibv_create_qp (3), |
| 173 |
.BR ibv_create_ah (3), |
| 174 |
.BR ibv_post_recv (3), |
| 175 |
.BR ibv_post_srq_recv (3), |
| 176 |
.BR ibv_poll_cq (3) |
| 177 |
.SH "AUTHORS" |
| 178 |
.TP |
| 179 |
Dotan Barak <[email protected]> |
| 180 |
.TP |
| 181 |
Majd Dibbiny <[email protected]> |
| 182 |
.TP |
| 183 |
Yishai Hadas <[email protected]> |