Lines Matching refs:qp
44 void qib_migrate_qp(struct rvt_qp *qp) in qib_migrate_qp() argument
48 qp->s_mig_state = IB_MIG_MIGRATED; in qib_migrate_qp()
49 qp->remote_ah_attr = qp->alt_ah_attr; in qib_migrate_qp()
50 qp->port_num = rdma_ah_get_port_num(&qp->alt_ah_attr); in qib_migrate_qp()
51 qp->s_pkey_index = qp->s_alt_pkey_index; in qib_migrate_qp()
53 ev.device = qp->ibqp.device; in qib_migrate_qp()
54 ev.element.qp = &qp->ibqp; in qib_migrate_qp()
56 qp->ibqp.event_handler(&ev, qp->ibqp.qp_context); in qib_migrate_qp()
83 int has_grh, struct rvt_qp *qp, u32 bth0) in qib_ruc_check_hdr() argument
88 if (qp->s_mig_state == IB_MIG_ARMED && (bth0 & IB_BTH_MIG_REQ)) { in qib_ruc_check_hdr()
90 if (rdma_ah_get_ah_flags(&qp->alt_ah_attr) & in qib_ruc_check_hdr()
96 if (!(rdma_ah_get_ah_flags(&qp->alt_ah_attr) & in qib_ruc_check_hdr()
99 grh = rdma_ah_read_grh(&qp->alt_ah_attr); in qib_ruc_check_hdr()
110 qib_get_pkey(ibp, qp->s_alt_pkey_index))) { in qib_ruc_check_hdr()
114 0, qp->ibqp.qp_num, in qib_ruc_check_hdr()
120 rdma_ah_get_dlid(&qp->alt_ah_attr)) || in qib_ruc_check_hdr()
122 rdma_ah_get_port_num(&qp->alt_ah_attr)) in qib_ruc_check_hdr()
124 spin_lock_irqsave(&qp->s_lock, flags); in qib_ruc_check_hdr()
125 qib_migrate_qp(qp); in qib_ruc_check_hdr()
126 spin_unlock_irqrestore(&qp->s_lock, flags); in qib_ruc_check_hdr()
129 if (rdma_ah_get_ah_flags(&qp->remote_ah_attr) & in qib_ruc_check_hdr()
135 if (!(rdma_ah_get_ah_flags(&qp->remote_ah_attr) & in qib_ruc_check_hdr()
138 grh = rdma_ah_read_grh(&qp->remote_ah_attr); in qib_ruc_check_hdr()
149 qib_get_pkey(ibp, qp->s_pkey_index))) { in qib_ruc_check_hdr()
153 0, qp->ibqp.qp_num, in qib_ruc_check_hdr()
159 rdma_ah_get_dlid(&qp->remote_ah_attr) || in qib_ruc_check_hdr()
160 ppd_from_ibp(ibp)->port != qp->port_num) in qib_ruc_check_hdr()
162 if (qp->s_mig_state == IB_MIG_REARM && in qib_ruc_check_hdr()
164 qp->s_mig_state = IB_MIG_ARMED; in qib_ruc_check_hdr()
206 void qib_make_ruc_header(struct rvt_qp *qp, struct ib_other_headers *ohdr, in qib_make_ruc_header() argument
209 struct qib_qp_priv *priv = qp->priv; in qib_make_ruc_header()
210 struct qib_ibport *ibp = to_iport(qp->ibqp.device, qp->port_num); in qib_make_ruc_header()
216 extra_bytes = -qp->s_cur_size & 3; in qib_make_ruc_header()
217 nwords = (qp->s_cur_size + extra_bytes) >> 2; in qib_make_ruc_header()
219 if (unlikely(rdma_ah_get_ah_flags(&qp->remote_ah_attr) & IB_AH_GRH)) { in qib_make_ruc_header()
220 qp->s_hdrwords += in qib_make_ruc_header()
222 rdma_ah_read_grh(&qp->remote_ah_attr), in qib_make_ruc_header()
223 qp->s_hdrwords, nwords); in qib_make_ruc_header()
226 lrh0 |= ibp->sl_to_vl[rdma_ah_get_sl(&qp->remote_ah_attr)] << 12 | in qib_make_ruc_header()
227 rdma_ah_get_sl(&qp->remote_ah_attr) << 4; in qib_make_ruc_header()
230 cpu_to_be16(rdma_ah_get_dlid(&qp->remote_ah_attr)); in qib_make_ruc_header()
232 cpu_to_be16(qp->s_hdrwords + nwords + SIZE_OF_CRC); in qib_make_ruc_header()
235 rdma_ah_get_path_bits(&qp->remote_ah_attr)); in qib_make_ruc_header()
236 bth0 |= qib_get_pkey(ibp, qp->s_pkey_index); in qib_make_ruc_header()
238 if (qp->s_mig_state == IB_MIG_MIGRATED) in qib_make_ruc_header()
241 ohdr->bth[1] = cpu_to_be32(qp->remote_qpn); in qib_make_ruc_header()
250 struct rvt_qp *qp = priv->owner; in _qib_do_send() local
252 qib_do_send(qp); in _qib_do_send()
263 void qib_do_send(struct rvt_qp *qp) in qib_do_send() argument
265 struct qib_qp_priv *priv = qp->priv; in qib_do_send()
266 struct qib_ibport *ibp = to_iport(qp->ibqp.device, qp->port_num); in qib_do_send()
268 int (*make_req)(struct rvt_qp *qp, unsigned long *flags); in qib_do_send()
271 if ((qp->ibqp.qp_type == IB_QPT_RC || in qib_do_send()
272 qp->ibqp.qp_type == IB_QPT_UC) && in qib_do_send()
273 (rdma_ah_get_dlid(&qp->remote_ah_attr) & in qib_do_send()
275 rvt_ruc_loopback(qp); in qib_do_send()
279 if (qp->ibqp.qp_type == IB_QPT_RC) in qib_do_send()
281 else if (qp->ibqp.qp_type == IB_QPT_UC) in qib_do_send()
286 spin_lock_irqsave(&qp->s_lock, flags); in qib_do_send()
289 if (!qib_send_ok(qp)) { in qib_do_send()
290 spin_unlock_irqrestore(&qp->s_lock, flags); in qib_do_send()
294 qp->s_flags |= RVT_S_BUSY; in qib_do_send()
298 if (qp->s_hdrwords != 0) { in qib_do_send()
299 spin_unlock_irqrestore(&qp->s_lock, flags); in qib_do_send()
304 if (qib_verbs_send(qp, priv->s_hdr, qp->s_hdrwords, in qib_do_send()
305 qp->s_cur_sge, qp->s_cur_size)) in qib_do_send()
308 qp->s_hdrwords = 0; in qib_do_send()
309 spin_lock_irqsave(&qp->s_lock, flags); in qib_do_send()
311 } while (make_req(qp, &flags)); in qib_do_send()
313 spin_unlock_irqrestore(&qp->s_lock, flags); in qib_do_send()