• Home
  • Raw
  • Download

Lines Matching refs:qp

63 int hfi1_make_uc_req(struct rvt_qp *qp, struct hfi1_pkt_state *ps)  in hfi1_make_uc_req()  argument
65 struct hfi1_qp_priv *priv = qp->priv; in hfi1_make_uc_req()
71 u32 pmtu = qp->pmtu; in hfi1_make_uc_req()
74 ps->s_txreq = get_txreq(ps->dev, qp); in hfi1_make_uc_req()
78 if (!(ib_rvt_state_ops[qp->state] & RVT_PROCESS_SEND_OK)) { in hfi1_make_uc_req()
79 if (!(ib_rvt_state_ops[qp->state] & RVT_FLUSH_SEND)) in hfi1_make_uc_req()
82 if (qp->s_last == READ_ONCE(qp->s_head)) in hfi1_make_uc_req()
86 qp->s_flags |= RVT_S_WAIT_DMA; in hfi1_make_uc_req()
89 clear_ahg(qp); in hfi1_make_uc_req()
90 wqe = rvt_get_swqe_ptr(qp, qp->s_last); in hfi1_make_uc_req()
91 rvt_send_complete(qp, wqe, IB_WC_WR_FLUSH_ERR); in hfi1_make_uc_req()
98 if (rdma_ah_get_ah_flags(&qp->remote_ah_attr) & IB_AH_GRH) in hfi1_make_uc_req()
105 if ((rdma_ah_get_ah_flags(&qp->remote_ah_attr) & IB_AH_GRH) && in hfi1_make_uc_req()
106 (hfi1_check_mcast(rdma_ah_get_dlid(&qp->remote_ah_attr)))) in hfi1_make_uc_req()
113 wqe = rvt_get_swqe_ptr(qp, qp->s_cur); in hfi1_make_uc_req()
114 qp->s_wqe = NULL; in hfi1_make_uc_req()
115 switch (qp->s_state) { in hfi1_make_uc_req()
117 if (!(ib_rvt_state_ops[qp->state] & in hfi1_make_uc_req()
121 if (qp->s_cur == READ_ONCE(qp->s_head)) { in hfi1_make_uc_req()
122 clear_ahg(qp); in hfi1_make_uc_req()
134 if (qp->s_last != qp->s_cur) in hfi1_make_uc_req()
136 if (++qp->s_cur == qp->s_size) in hfi1_make_uc_req()
137 qp->s_cur = 0; in hfi1_make_uc_req()
140 qp, wqe->wr.ex.invalidate_rkey); in hfi1_make_uc_req()
143 rvt_send_complete(qp, wqe, err ? IB_WC_LOC_PROT_ERR in hfi1_make_uc_req()
146 atomic_dec(&qp->local_ops_pending); in hfi1_make_uc_req()
152 qp->s_psn = wqe->psn; in hfi1_make_uc_req()
153 qp->s_sge.sge = wqe->sg_list[0]; in hfi1_make_uc_req()
154 qp->s_sge.sg_list = wqe->sg_list + 1; in hfi1_make_uc_req()
155 qp->s_sge.num_sge = wqe->wr.num_sge; in hfi1_make_uc_req()
156 qp->s_sge.total_len = wqe->length; in hfi1_make_uc_req()
158 qp->s_len = len; in hfi1_make_uc_req()
163 qp->s_state = OP(SEND_FIRST); in hfi1_make_uc_req()
168 qp->s_state = OP(SEND_ONLY); in hfi1_make_uc_req()
170 qp->s_state = in hfi1_make_uc_req()
178 qp->s_wqe = wqe; in hfi1_make_uc_req()
179 if (++qp->s_cur >= qp->s_size) in hfi1_make_uc_req()
180 qp->s_cur = 0; in hfi1_make_uc_req()
192 qp->s_state = OP(RDMA_WRITE_FIRST); in hfi1_make_uc_req()
197 qp->s_state = OP(RDMA_WRITE_ONLY); in hfi1_make_uc_req()
199 qp->s_state = in hfi1_make_uc_req()
207 qp->s_wqe = wqe; in hfi1_make_uc_req()
208 if (++qp->s_cur >= qp->s_size) in hfi1_make_uc_req()
209 qp->s_cur = 0; in hfi1_make_uc_req()
218 qp->s_state = OP(SEND_MIDDLE); in hfi1_make_uc_req()
221 len = qp->s_len; in hfi1_make_uc_req()
228 qp->s_state = OP(SEND_LAST); in hfi1_make_uc_req()
230 qp->s_state = OP(SEND_LAST_WITH_IMMEDIATE); in hfi1_make_uc_req()
237 qp->s_wqe = wqe; in hfi1_make_uc_req()
238 if (++qp->s_cur >= qp->s_size) in hfi1_make_uc_req()
239 qp->s_cur = 0; in hfi1_make_uc_req()
243 qp->s_state = OP(RDMA_WRITE_MIDDLE); in hfi1_make_uc_req()
246 len = qp->s_len; in hfi1_make_uc_req()
253 qp->s_state = OP(RDMA_WRITE_LAST); in hfi1_make_uc_req()
255 qp->s_state = in hfi1_make_uc_req()
263 qp->s_wqe = wqe; in hfi1_make_uc_req()
264 if (++qp->s_cur >= qp->s_size) in hfi1_make_uc_req()
265 qp->s_cur = 0; in hfi1_make_uc_req()
268 qp->s_len -= len; in hfi1_make_uc_req()
271 ps->s_txreq->ss = &qp->s_sge; in hfi1_make_uc_req()
273 hfi1_make_ruc_header(qp, ohdr, bth0 | (qp->s_state << 24), in hfi1_make_uc_req()
274 qp->remote_qpn, mask_psn(qp->s_psn++), in hfi1_make_uc_req()
288 qp->s_flags &= ~RVT_S_BUSY; in hfi1_make_uc_req()
310 struct rvt_qp *qp = packet->qp; in hfi1_uc_rcv() local
317 u32 pmtu = qp->pmtu; in hfi1_uc_rcv()
325 process_ecn(qp, packet); in hfi1_uc_rcv()
329 if (unlikely(cmp_psn(psn, qp->r_psn) != 0)) { in hfi1_uc_rcv()
334 qp->r_psn = psn; in hfi1_uc_rcv()
336 if (qp->r_state == OP(SEND_FIRST) || in hfi1_uc_rcv()
337 qp->r_state == OP(SEND_MIDDLE)) { in hfi1_uc_rcv()
338 set_bit(RVT_R_REWIND_SGE, &qp->r_aflags); in hfi1_uc_rcv()
339 qp->r_sge.num_sge = 0; in hfi1_uc_rcv()
341 rvt_put_ss(&qp->r_sge); in hfi1_uc_rcv()
343 qp->r_state = OP(SEND_LAST); in hfi1_uc_rcv()
361 switch (qp->r_state) { in hfi1_uc_rcv()
389 if (qp->state == IB_QPS_RTR && !(qp->r_flags & RVT_R_COMM_EST)) in hfi1_uc_rcv()
390 rvt_comm_est(qp); in hfi1_uc_rcv()
398 if (test_and_clear_bit(RVT_R_REWIND_SGE, &qp->r_aflags)) { in hfi1_uc_rcv()
399 qp->r_sge = qp->s_rdma_read_sge; in hfi1_uc_rcv()
401 ret = rvt_get_rwqe(qp, false); in hfi1_uc_rcv()
410 qp->s_rdma_read_sge = qp->r_sge; in hfi1_uc_rcv()
412 qp->r_rcv_len = 0; in hfi1_uc_rcv()
427 qp->r_rcv_len += pmtu; in hfi1_uc_rcv()
428 if (unlikely(qp->r_rcv_len > qp->r_len)) in hfi1_uc_rcv()
430 rvt_copy_sge(qp, &qp->r_sge, data, pmtu, false, false); in hfi1_uc_rcv()
449 wc.byte_len = tlen + qp->r_rcv_len; in hfi1_uc_rcv()
450 if (unlikely(wc.byte_len > qp->r_len)) in hfi1_uc_rcv()
453 rvt_copy_sge(qp, &qp->r_sge, data, tlen, false, false); in hfi1_uc_rcv()
454 rvt_put_ss(&qp->s_rdma_read_sge); in hfi1_uc_rcv()
456 wc.wr_id = qp->r_wr_id; in hfi1_uc_rcv()
458 wc.qp = &qp->ibqp; in hfi1_uc_rcv()
459 wc.src_qp = qp->remote_qpn; in hfi1_uc_rcv()
460 wc.slid = rdma_ah_get_dlid(&qp->remote_ah_attr) & U16_MAX; in hfi1_uc_rcv()
472 wc.sl = rdma_ah_get_sl(&qp->remote_ah_attr); in hfi1_uc_rcv()
479 rvt_recv_cq(qp, &wc, ib_bth_is_solicited(ohdr)); in hfi1_uc_rcv()
486 if (unlikely(!(qp->qp_access_flags & in hfi1_uc_rcv()
491 qp->r_len = be32_to_cpu(reth->length); in hfi1_uc_rcv()
492 qp->r_rcv_len = 0; in hfi1_uc_rcv()
493 qp->r_sge.sg_list = NULL; in hfi1_uc_rcv()
494 if (qp->r_len != 0) { in hfi1_uc_rcv()
500 ok = rvt_rkey_ok(qp, &qp->r_sge.sge, qp->r_len, in hfi1_uc_rcv()
504 qp->r_sge.num_sge = 1; in hfi1_uc_rcv()
506 qp->r_sge.num_sge = 0; in hfi1_uc_rcv()
507 qp->r_sge.sge.mr = NULL; in hfi1_uc_rcv()
508 qp->r_sge.sge.vaddr = NULL; in hfi1_uc_rcv()
509 qp->r_sge.sge.length = 0; in hfi1_uc_rcv()
510 qp->r_sge.sge.sge_length = 0; in hfi1_uc_rcv()
523 qp->r_rcv_len += pmtu; in hfi1_uc_rcv()
524 if (unlikely(qp->r_rcv_len > qp->r_len)) in hfi1_uc_rcv()
526 rvt_copy_sge(qp, &qp->r_sge, data, pmtu, true, false); in hfi1_uc_rcv()
540 if (unlikely(tlen + qp->r_rcv_len != qp->r_len)) in hfi1_uc_rcv()
542 if (test_and_clear_bit(RVT_R_REWIND_SGE, &qp->r_aflags)) { in hfi1_uc_rcv()
543 rvt_put_ss(&qp->s_rdma_read_sge); in hfi1_uc_rcv()
545 ret = rvt_get_rwqe(qp, true); in hfi1_uc_rcv()
551 wc.byte_len = qp->r_len; in hfi1_uc_rcv()
553 rvt_copy_sge(qp, &qp->r_sge, data, tlen, true, false); in hfi1_uc_rcv()
554 rvt_put_ss(&qp->r_sge); in hfi1_uc_rcv()
565 if (unlikely(tlen + qp->r_rcv_len != qp->r_len)) in hfi1_uc_rcv()
567 rvt_copy_sge(qp, &qp->r_sge, data, tlen, true, false); in hfi1_uc_rcv()
568 rvt_put_ss(&qp->r_sge); in hfi1_uc_rcv()
575 qp->r_psn++; in hfi1_uc_rcv()
576 qp->r_state = opcode; in hfi1_uc_rcv()
580 set_bit(RVT_R_REWIND_SGE, &qp->r_aflags); in hfi1_uc_rcv()
581 qp->r_sge.num_sge = 0; in hfi1_uc_rcv()
587 rvt_rc_error(qp, IB_WC_LOC_QP_OP_ERR); in hfi1_uc_rcv()