Lines Matching refs:ps

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