38 #define OP(x) IB_OPCODE_UC_##x
70 wqe = get_swqe_ptr(qp, qp->
s_last);
75 ohdr = &qp->
s_hdr.u.oth;
77 ohdr = &qp->
s_hdr.u.l.oth;
84 wqe = get_swqe_ptr(qp, qp->
s_cur);
100 qp->
s_sge.num_sge = wqe->
wr.num_sge;
102 switch (wqe->
wr.opcode) {
114 OP(SEND_ONLY_WITH_IMMEDIATE);
128 ohdr->
u.
rc.reth.vaddr =
130 ohdr->
u.
rc.reth.rkey =
133 hwords +=
sizeof(
struct ib_reth) / 4;
143 OP(RDMA_WRITE_ONLY_WITH_IMMEDIATE);
145 ohdr->
u.
rc.imm_data = wqe->
wr.ex.imm_data;
163 case OP(SEND_MIDDLE):
172 qp->
s_state =
OP(SEND_LAST_WITH_IMMEDIATE);
184 case OP(RDMA_WRITE_FIRST):
187 case OP(RDMA_WRITE_MIDDLE):
197 OP(RDMA_WRITE_LAST_WITH_IMMEDIATE);
214 qp, ohdr, bth0 | (qp->
s_state << 24),
223 spin_unlock_irqrestore(&qp->
s_lock, flags);
264 ohdr = &hdr->
u.
l.oth;
265 hdrsize = 8 + 40 + 12;
272 header_in_data = dev->
dd->ipath_rcvhdrentsize == 16;
273 if (header_in_data) {
285 memset(&wc, 0,
sizeof wc);
299 case OP(SEND_ONLY_WITH_IMMEDIATE):
302 case OP(RDMA_WRITE_FIRST):
303 case OP(RDMA_WRITE_ONLY):
304 case OP(RDMA_WRITE_ONLY_WITH_IMMEDIATE):
316 case OP(SEND_MIDDLE):
317 if (opcode ==
OP(SEND_MIDDLE) ||
318 opcode ==
OP(SEND_LAST) ||
319 opcode ==
OP(SEND_LAST_WITH_IMMEDIATE))
323 case OP(RDMA_WRITE_FIRST):
324 case OP(RDMA_WRITE_MIDDLE):
325 if (opcode ==
OP(RDMA_WRITE_MIDDLE) ||
326 opcode ==
OP(RDMA_WRITE_LAST) ||
327 opcode ==
OP(RDMA_WRITE_LAST_WITH_IMMEDIATE))
332 if (opcode ==
OP(SEND_FIRST) ||
333 opcode ==
OP(SEND_ONLY) ||
334 opcode ==
OP(SEND_ONLY_WITH_IMMEDIATE) ||
335 opcode ==
OP(RDMA_WRITE_FIRST) ||
336 opcode ==
OP(RDMA_WRITE_ONLY) ||
337 opcode ==
OP(RDMA_WRITE_ONLY_WITH_IMMEDIATE))
346 case OP(SEND_ONLY_WITH_IMMEDIATE):
358 if (opcode ==
OP(SEND_ONLY))
360 else if (opcode ==
OP(SEND_ONLY_WITH_IMMEDIATE))
363 case OP(SEND_MIDDLE):
365 if (
unlikely(tlen != (hdrsize + pmtu + 4))) {
379 case OP(SEND_LAST_WITH_IMMEDIATE):
381 if (header_in_data) {
397 if (
unlikely(tlen < (hdrsize + pad + 4))) {
403 tlen -= (hdrsize + pad + 4);
425 case OP(RDMA_WRITE_FIRST):
426 case OP(RDMA_WRITE_ONLY):
427 case OP(RDMA_WRITE_ONLY_WITH_IMMEDIATE):
431 reth = &ohdr->
u.
rc.reth;
434 data +=
sizeof(*reth);
436 hdrsize +=
sizeof(*reth);
439 if (qp->
r_len != 0) {
456 qp->
r_sge.sge.length = 0;
457 qp->
r_sge.sge.sge_length = 0;
464 if (opcode ==
OP(RDMA_WRITE_ONLY))
466 else if (opcode ==
OP(RDMA_WRITE_ONLY_WITH_IMMEDIATE))
469 case OP(RDMA_WRITE_MIDDLE):
471 if (
unlikely(tlen != (hdrsize + pmtu + 4))) {
483 case OP(RDMA_WRITE_LAST_WITH_IMMEDIATE):
485 if (header_in_data) {
499 if (
unlikely(tlen < (hdrsize + pad + 4))) {
504 tlen -= (hdrsize + pad + 4);
519 case OP(RDMA_WRITE_LAST):
525 if (
unlikely(tlen < (hdrsize + pad + 4))) {
530 tlen -= (hdrsize + pad + 4);