49 static void qib_ud_loopback(
struct qib_qp *sqp,
struct qib_swqe *swqe)
66 if (qp->
ibqp.qp_type != sqp->
ibqp.qp_type ||
72 ah_attr = &to_iah(swqe->
wr.wr.ud.ah)->attr;
73 ppd = ppd_from_ibp(ibp);
75 if (qp->
ibqp.qp_num > 1) {
82 if (
unlikely(!qib_pkey_ok(pkey1, pkey2))) {
84 ((1 << ppd->
lmc) - 1));
99 if (qp->
ibqp.qp_num) {
102 qkey = (
int)swqe->
wr.wr.ud.remote_qkey < 0 ?
103 sqp->
qkey : swqe->
wr.wr.ud.remote_qkey;
108 ((1 << ppd->
lmc) - 1));
124 wc.byte_len = length +
sizeof(
struct ib_grh);
128 wc.ex.imm_data = swqe->
wr.ex.imm_data;
147 if (qp->
ibqp.qp_num == 0)
161 sizeof(
struct ib_grh), 1);
165 ssge.sg_list = swqe->
sg_list + 1;
167 ssge.num_sge = swqe->
wr.num_sge;
183 *sge = *ssge.sg_list++;
184 }
else if (sge->
length == 0 && sge->
mr->lkey) {
186 if (++sge->
m >= sge->
mr->mapsz)
191 sge->
mr->map[sge->
m]->segs[sge->
n].vaddr;
193 sge->
mr->map[sge->
m]->segs[sge->
n].length;
197 qib_put_ss(&qp->
r_sge);
204 wc.src_qp = sqp->
ibqp.qp_num;
206 swqe->
wr.wr.ud.pkey_index : 0;
209 wc.dlid_path_bits = ah_attr->
dlid & ((1 << ppd->
lmc) - 1);
216 spin_unlock_irqrestore(&qp->r_lock, flags);
257 wqe = get_swqe_ptr(qp, qp->
s_last);
265 wqe = get_swqe_ptr(qp, qp->
s_cur);
266 next_cur = qp->
s_cur + 1;
267 if (next_cur >= qp->
s_size)
272 ppd = ppd_from_ibp(ibp);
273 ah_attr = &to_iah(wqe->
wr.wr.ud.ah)->attr;
281 lid = ah_attr->
dlid & ~((1 << ppd->
lmc) - 1);
294 qp->
s_cur = next_cur;
295 spin_unlock_irqrestore(&qp->s_lock, flags);
296 qib_ud_loopback(qp, wqe);
303 qp->
s_cur = next_cur;
304 extra_bytes = -wqe->
length & 3;
305 nwords = (wqe->
length + extra_bytes) >> 2;
315 qp->
s_sge.num_sge = wqe->
wr.num_sge;
324 ohdr = &qp->
s_hdr->u.l.oth;
332 ohdr = &qp->
s_hdr->u.oth;
336 ohdr->
u.
ud.imm_data = wqe->
wr.ex.imm_data;
337 bth0 = IB_OPCODE_UD_SEND_ONLY_WITH_IMMEDIATE << 24;
339 bth0 = IB_OPCODE_UD_SEND_ONLY << 24;
340 lrh0 |= ah_attr->
sl << 4;
356 bth0 |= extra_bytes << 20;
374 qp->
qkey : wqe->
wr.wr.ud.remote_qkey);
384 spin_unlock_irqrestore(&qp->s_lock, flags);
398 if ((dd->
rcd[ctxt]->pkeys[i] & 0x7fff) ==
pkey)
436 hdrsize = 8 + 12 + 8;
438 ohdr = &hdr->
u.
l.oth;
439 hdrsize = 8 + 40 + 12 + 8;
449 if (
unlikely(tlen < (hdrsize + pad + 4)))
452 tlen -= hdrsize + pad + 4;
458 if (qp->
ibqp.qp_num) {
462 if (qp->
ibqp.qp_num > 1) {
467 if (
unlikely(!qib_pkey_ok(pkey1, pkey2))) {
472 src_qp, qp->
ibqp.qp_num,
473 hdr->
lrh[3], hdr->
lrh[1]);
480 src_qp, qp->
ibqp.qp_num,
481 hdr->
lrh[3], hdr->
lrh[1]);
495 smp = (
struct ib_smp *) data;
507 if (qp->
ibqp.qp_num > 1 &&
508 opcode == IB_OPCODE_UD_SEND_ONLY_WITH_IMMEDIATE) {
512 }
else if (opcode == IB_OPCODE_UD_SEND_ONLY) {
538 if (qp->
ibqp.qp_num == 0)
550 sizeof(
struct ib_grh), 1);
555 qib_put_ss(&qp->
r_sge);
573 dlid & ((1 << ppd_from_ibp(ibp)->lmc) - 1);