Lines Matching refs:ps

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