34 #include <linux/sched.h>
80 ((
int) swqe->
wr.wr.ud.remote_qkey < 0 ?
81 sqp->
qkey : swqe->
wr.wr.ud.remote_qkey) != qp->
qkey)) {
94 wc.byte_len = length +
sizeof(
struct ib_grh);
98 wc.ex.imm_data = swqe->
wr.ex.imm_data;
108 srq = to_isrq(qp->
ibqp.srq);
126 if (tail >= rq->
size)
129 spin_unlock_irqrestore(&rq->
lock, flags);
133 wqe = get_rwqe_ptr(rq, tail);
136 spin_unlock_irqrestore(&rq->
lock, flags);
141 if (
wc.byte_len > rlen) {
142 spin_unlock_irqrestore(&rq->
lock, flags);
146 if (++tail >= rq->
size)
164 if (n < srq->
limit) {
168 spin_unlock_irqrestore(&rq->
lock, flags);
169 ev.device = qp->
ibqp.device;
170 ev.element.srq = qp->
ibqp.srq;
174 spin_unlock_irqrestore(&rq->
lock, flags);
176 spin_unlock_irqrestore(&rq->
lock, flags);
178 ah_attr = &to_iah(swqe->
wr.wr.ud.ah)->attr;
198 if (--swqe->
wr.num_sge)
202 if (++sge->
m >= sge->
mr->mapsz)
207 sge->
mr->map[sge->
m]->segs[sge->
n].vaddr;
209 sge->
mr->map[sge->
m]->segs[sge->
n].length;
216 wc.src_qp = sqp->
ibqp.qp_num;
219 wc.slid = dev->
dd->ipath_lid |
221 ((1 << dev->
dd->ipath_lmc) - 1));
224 ah_attr->
dlid & ((1 << dev->
dd->ipath_lmc) - 1);
269 wqe = get_swqe_ptr(qp, qp->
s_last);
277 wqe = get_swqe_ptr(qp, qp->
s_cur);
278 next_cur = qp->
s_cur + 1;
279 if (next_cur >= qp->
s_size)
283 ah_attr = &to_iah(wqe->
wr.wr.ud.ah)->attr;
291 lid = ah_attr->
dlid & ~((1 << dev->
dd->ipath_lmc) - 1);
304 qp->
s_cur = next_cur;
305 spin_unlock_irqrestore(&qp->
s_lock, flags);
306 ipath_ud_loopback(qp, wqe);
313 qp->
s_cur = next_cur;
314 extra_bytes = -wqe->
length & 3;
315 nwords = (wqe->
length + extra_bytes) >> 2;
325 qp->
s_sge.num_sge = wqe->
wr.num_sge;
333 ohdr = &qp->
s_hdr.u.l.oth;
341 ohdr = &qp->
s_hdr.u.oth;
345 ohdr->
u.
ud.imm_data = wqe->
wr.ex.imm_data;
346 bth0 = IB_OPCODE_UD_SEND_ONLY_WITH_IMMEDIATE << 24;
348 bth0 = IB_OPCODE_UD_SEND_ONLY << 24;
349 lrh0 |= ah_attr->
sl << 4;
356 lid = dev->
dd->ipath_lid;
359 ((1 << dev->
dd->ipath_lmc) - 1);
365 bth0 |= extra_bytes << 20;
382 qp->
qkey : wqe->
wr.wr.ud.remote_qkey);
392 spin_unlock_irqrestore(&qp->
s_lock, flags);
425 hdrsize = 8 + 12 + 8;
430 ohdr = &hdr->
u.
l.oth;
431 hdrsize = 8 + 40 + 12 + 8;
437 header_in_data = dev->
dd->ipath_rcvhdrentsize == 16;
438 if (header_in_data) {
453 if (qp->
ibqp.qp_num) {
480 if (qp->
ibqp.qp_num > 1 &&
481 opcode == IB_OPCODE_UD_SEND_ONLY_WITH_IMMEDIATE) {
482 if (header_in_data) {
488 hdrsize +=
sizeof(
u32);
489 }
else if (opcode == IB_OPCODE_UD_SEND_ONLY) {
499 if (
unlikely(tlen < (hdrsize + pad + 4))) {
504 tlen -= hdrsize + pad + 4;
510 (qp->
ibqp.qp_num == 1 &&
535 if (qp->
ibqp.qp_num == 0)
572 dlid & ((1 << dev->
dd->ipath_lmc) - 1);