Lines Matching full:ps

265  * @ps: the current packet state
276 struct hfi1_pkt_state *ps) in hfi1_make_ruc_header_16B() argument
279 struct hfi1_ibport *ibp = ps->ibp; in hfi1_make_ruc_header_16B()
285 (ps->s_txreq->hdr_dwords << 2), in hfi1_make_ruc_header_16B()
286 ps->s_txreq->s_cur_size); in hfi1_make_ruc_header_16B()
287 u32 nwords = SIZE_OF_CRC + ((ps->s_txreq->s_cur_size + in hfi1_make_ruc_header_16B()
302 grh = &ps->s_txreq->phdr.hdr.opah.u.l.grh; in hfi1_make_ruc_header_16B()
304 ps->s_txreq->hdr_dwords += in hfi1_make_ruc_header_16B()
306 ps->s_txreq->hdr_dwords - LRH_16B_DWORDS, in hfi1_make_ruc_header_16B()
338 hfi1_make_16b_hdr(&ps->s_txreq->phdr.hdr.opah, in hfi1_make_ruc_header_16B()
342 (ps->s_txreq->hdr_dwords + nwords) >> 1, in hfi1_make_ruc_header_16B()
353 * @ps: the current packet state
364 struct hfi1_pkt_state *ps) in hfi1_make_ruc_header_9B() argument
367 struct hfi1_ibport *ibp = ps->ibp; in hfi1_make_ruc_header_9B()
370 u8 extra_bytes = -ps->s_txreq->s_cur_size & 3; in hfi1_make_ruc_header_9B()
371 u32 nwords = SIZE_OF_CRC + ((ps->s_txreq->s_cur_size + in hfi1_make_ruc_header_9B()
375 struct ib_grh *grh = &ps->s_txreq->phdr.hdr.ibh.u.l.grh; in hfi1_make_ruc_header_9B()
378 ps->s_txreq->hdr_dwords += in hfi1_make_ruc_header_9B()
381 ps->s_txreq->hdr_dwords - LRH_9B_DWORDS, in hfi1_make_ruc_header_9B()
407 hfi1_make_ib_hdr(&ps->s_txreq->phdr.hdr.ibh, in hfi1_make_ruc_header_9B()
409 ps->s_txreq->hdr_dwords + nwords, in hfi1_make_ruc_header_9B()
418 struct hfi1_pkt_state *ps);
428 struct hfi1_pkt_state *ps) in hfi1_make_ruc_header() argument
449 ps); in hfi1_make_ruc_header()
460 * @ps: a pointer to a structure with commonly lookup values for
470 bool hfi1_schedule_send_yield(struct rvt_qp *qp, struct hfi1_pkt_state *ps, in hfi1_schedule_send_yield() argument
473 ps->pkts_sent = true; in hfi1_schedule_send_yield()
475 if (unlikely(time_after(jiffies, ps->timeout))) { in hfi1_schedule_send_yield()
476 if (!ps->in_thread || in hfi1_schedule_send_yield()
477 workqueue_congested(ps->cpu, ps->ppd->hfi1_wq)) { in hfi1_schedule_send_yield()
478 spin_lock_irqsave(&qp->s_lock, ps->flags); in hfi1_schedule_send_yield()
497 spin_unlock_irqrestore(&qp->s_lock, ps->flags); in hfi1_schedule_send_yield()
498 this_cpu_inc(*ps->ppd->dd->send_schedule); in hfi1_schedule_send_yield()
504 this_cpu_inc(*ps->ppd->dd->send_schedule); in hfi1_schedule_send_yield()
505 ps->timeout = jiffies + ps->timeout_int; in hfi1_schedule_send_yield()
536 struct hfi1_pkt_state ps; in hfi1_do_send() local
538 int (*make_req)(struct rvt_qp *qp, struct hfi1_pkt_state *ps); in hfi1_do_send()
540 ps.dev = to_idev(qp->ibqp.device); in hfi1_do_send()
541 ps.ibp = to_iport(qp->ibqp.device, qp->port_num); in hfi1_do_send()
542 ps.ppd = ppd_from_ibp(ps.ibp); in hfi1_do_send()
543 ps.in_thread = in_thread; in hfi1_do_send()
544 ps.wait = iowait_get_ib_work(&priv->s_iowait); in hfi1_do_send()
551 ~((1 << ps.ppd->lmc) - 1)) == in hfi1_do_send()
552 ps.ppd->lid)) { in hfi1_do_send()
557 ps.timeout_int = qp->timeout_jiffies; in hfi1_do_send()
561 ~((1 << ps.ppd->lmc) - 1)) == in hfi1_do_send()
562 ps.ppd->lid)) { in hfi1_do_send()
567 ps.timeout_int = SEND_RESCHED_TIMEOUT; in hfi1_do_send()
571 ps.timeout_int = SEND_RESCHED_TIMEOUT; in hfi1_do_send()
574 spin_lock_irqsave(&qp->s_lock, ps.flags); in hfi1_do_send()
580 spin_unlock_irqrestore(&qp->s_lock, ps.flags); in hfi1_do_send()
586 ps.timeout_int = ps.timeout_int / 8; in hfi1_do_send()
587 ps.timeout = jiffies + ps.timeout_int; in hfi1_do_send()
588 ps.cpu = priv->s_sde ? priv->s_sde->cpu : in hfi1_do_send()
589 cpumask_first(cpumask_of_node(ps.ppd->dd->node)); in hfi1_do_send()
590 ps.pkts_sent = false; in hfi1_do_send()
593 ps.s_txreq = get_waiting_verbs_txreq(ps.wait); in hfi1_do_send()
596 if (ps.s_txreq) { in hfi1_do_send()
599 spin_unlock_irqrestore(&qp->s_lock, ps.flags); in hfi1_do_send()
604 if (hfi1_verbs_send(qp, &ps)) in hfi1_do_send()
608 if (hfi1_schedule_send_yield(qp, &ps, false)) in hfi1_do_send()
611 spin_lock_irqsave(&qp->s_lock, ps.flags); in hfi1_do_send()
613 } while (make_req(qp, &ps)); in hfi1_do_send()
614 iowait_starve_clear(ps.pkts_sent, &priv->s_iowait); in hfi1_do_send()
615 spin_unlock_irqrestore(&qp->s_lock, ps.flags); in hfi1_do_send()