Lines Matching refs:ps
235 struct hfi1_pkt_state *ps) in hfi1_make_ruc_header_16B() argument
238 struct hfi1_ibport *ibp = ps->ibp; in hfi1_make_ruc_header_16B()
244 (ps->s_txreq->hdr_dwords << 2), in hfi1_make_ruc_header_16B()
245 ps->s_txreq->s_cur_size); in hfi1_make_ruc_header_16B()
246 u32 nwords = SIZE_OF_CRC + ((ps->s_txreq->s_cur_size + in hfi1_make_ruc_header_16B()
261 grh = &ps->s_txreq->phdr.hdr.opah.u.l.grh; in hfi1_make_ruc_header_16B()
263 ps->s_txreq->hdr_dwords += in hfi1_make_ruc_header_16B()
265 ps->s_txreq->hdr_dwords - LRH_16B_DWORDS, in hfi1_make_ruc_header_16B()
297 hfi1_make_16b_hdr(&ps->s_txreq->phdr.hdr.opah, in hfi1_make_ruc_header_16B()
301 (ps->s_txreq->hdr_dwords + nwords) >> 1, in hfi1_make_ruc_header_16B()
324 struct hfi1_pkt_state *ps) in hfi1_make_ruc_header_9B() argument
327 struct hfi1_ibport *ibp = ps->ibp; in hfi1_make_ruc_header_9B()
330 u8 extra_bytes = -ps->s_txreq->s_cur_size & 3; in hfi1_make_ruc_header_9B()
331 u32 nwords = SIZE_OF_CRC + ((ps->s_txreq->s_cur_size + in hfi1_make_ruc_header_9B()
335 struct ib_grh *grh = &ps->s_txreq->phdr.hdr.ibh.u.l.grh; in hfi1_make_ruc_header_9B()
338 ps->s_txreq->hdr_dwords += in hfi1_make_ruc_header_9B()
341 ps->s_txreq->hdr_dwords - LRH_9B_DWORDS, in hfi1_make_ruc_header_9B()
367 hfi1_make_ib_hdr(&ps->s_txreq->phdr.hdr.ibh, in hfi1_make_ruc_header_9B()
369 ps->s_txreq->hdr_dwords + nwords, in hfi1_make_ruc_header_9B()
378 struct hfi1_pkt_state *ps);
388 struct hfi1_pkt_state *ps) in hfi1_make_ruc_header() argument
409 ps); in hfi1_make_ruc_header()
429 bool hfi1_schedule_send_yield(struct rvt_qp *qp, struct hfi1_pkt_state *ps, in hfi1_schedule_send_yield() argument
432 ps->pkts_sent = true; in hfi1_schedule_send_yield()
434 if (unlikely(time_after(jiffies, ps->timeout))) { in hfi1_schedule_send_yield()
435 if (!ps->in_thread || in hfi1_schedule_send_yield()
436 workqueue_congested(ps->cpu, ps->ppd->hfi1_wq)) { in hfi1_schedule_send_yield()
437 spin_lock_irqsave(&qp->s_lock, ps->flags); in hfi1_schedule_send_yield()
456 spin_unlock_irqrestore(&qp->s_lock, ps->flags); in hfi1_schedule_send_yield()
457 this_cpu_inc(*ps->ppd->dd->send_schedule); in hfi1_schedule_send_yield()
463 this_cpu_inc(*ps->ppd->dd->send_schedule); in hfi1_schedule_send_yield()
464 ps->timeout = jiffies + ps->timeout_int; in hfi1_schedule_send_yield()
495 struct hfi1_pkt_state ps; in hfi1_do_send() local
497 int (*make_req)(struct rvt_qp *qp, struct hfi1_pkt_state *ps); in hfi1_do_send()
499 ps.dev = to_idev(qp->ibqp.device); in hfi1_do_send()
500 ps.ibp = to_iport(qp->ibqp.device, qp->port_num); in hfi1_do_send()
501 ps.ppd = ppd_from_ibp(ps.ibp); in hfi1_do_send()
502 ps.in_thread = in_thread; in hfi1_do_send()
503 ps.wait = iowait_get_ib_work(&priv->s_iowait); in hfi1_do_send()
510 ~((1 << ps.ppd->lmc) - 1)) == in hfi1_do_send()
511 ps.ppd->lid)) { in hfi1_do_send()
516 ps.timeout_int = qp->timeout_jiffies; in hfi1_do_send()
520 ~((1 << ps.ppd->lmc) - 1)) == in hfi1_do_send()
521 ps.ppd->lid)) { in hfi1_do_send()
526 ps.timeout_int = SEND_RESCHED_TIMEOUT; in hfi1_do_send()
530 ps.timeout_int = SEND_RESCHED_TIMEOUT; in hfi1_do_send()
533 spin_lock_irqsave(&qp->s_lock, ps.flags); in hfi1_do_send()
539 spin_unlock_irqrestore(&qp->s_lock, ps.flags); in hfi1_do_send()
545 ps.timeout_int = ps.timeout_int / 8; in hfi1_do_send()
546 ps.timeout = jiffies + ps.timeout_int; in hfi1_do_send()
547 ps.cpu = priv->s_sde ? priv->s_sde->cpu : in hfi1_do_send()
548 cpumask_first(cpumask_of_node(ps.ppd->dd->node)); in hfi1_do_send()
549 ps.pkts_sent = false; in hfi1_do_send()
552 ps.s_txreq = get_waiting_verbs_txreq(ps.wait); in hfi1_do_send()
555 if (ps.s_txreq) { in hfi1_do_send()
558 spin_unlock_irqrestore(&qp->s_lock, ps.flags); in hfi1_do_send()
563 if (hfi1_verbs_send(qp, &ps)) in hfi1_do_send()
567 if (hfi1_schedule_send_yield(qp, &ps, false)) in hfi1_do_send()
570 spin_lock_irqsave(&qp->s_lock, ps.flags); in hfi1_do_send()
572 } while (make_req(qp, &ps)); in hfi1_do_send()
573 iowait_starve_clear(ps.pkts_sent, &priv->s_iowait); in hfi1_do_send()
574 spin_unlock_irqrestore(&qp->s_lock, ps.flags); in hfi1_do_send()