Lines Matching refs:psn

58 struct rvt_ack_entry *find_prev_entry(struct rvt_qp *qp, u32 psn, u8 *prev,
82 if (cmp_psn(psn, e->psn) >= 0) {
84 cmp_psn(psn, e->lpsn) <= 0)
162 trace_hfi1_rsp_make_rc_ack(qp, e->psn);
212 qp->s_ack_rdma_psn = e->psn;
227 qp->s_ack_rdma_psn = mask_psn(e->psn + req->cur_seg);
261 bth2 = mask_psn(e->psn);
337 trace_hfi1_tid_req_make_rc_ack_write(qp, 0, e->opcode, e->psn,
574 qp->s_psn = wqe->psn;
751 req->comp_seg = delta_psn(bth2, wqe->psn);
764 wqe->psn, wqe->lpsn,
804 wqe->psn, wqe->lpsn,
806 delta = cmp_psn(qp->s_psn, wqe->psn);
1032 len = (delta_psn(qp->s_psn, wqe->psn)) * pmtu;
1060 req->comp_seg = delta_psn(qp->s_psn, wqe->psn);
1075 wqe->psn, wqe->lpsn, req);
1085 * Back down. The field qp->s_psn has been set to the psn with
1089 req->cur_seg = delta_psn(qp->s_psn, wqe->psn) / priv->pkts_ps;
1130 wqe->psn, wqe->lpsn, req);
1134 delta = cmp_psn(qp->s_psn, wqe->psn);
1173 wqe->psn, wqe->lpsn, req);
1177 delta = delta_psn(bth2, wqe->psn);
1452 * @psn: the packet sequence number to restart at
1459 static void update_num_rd_atomic(struct rvt_qp *qp, u32 psn,
1472 if (cmp_psn(psn, wqe->lpsn) <= 0) {
1475 cur_seg = (psn - wqe->psn) / priv->pkts_ps;
1481 wqe->psn,
1494 * @psn: the packet sequence number to restart at
1500 static void reset_psn(struct rvt_qp *qp, u32 psn)
1517 if (cmp_psn(psn, wqe->psn) <= 0) {
1521 update_num_rd_atomic(qp, psn, wqe);
1532 diff = cmp_psn(psn, wqe->psn);
1548 update_num_rd_atomic(qp, psn, wqe);
1589 qp->s_psn = psn;
1606 void hfi1_restart_rc(struct rvt_qp *qp, u32 psn, int wait)
1662 ibp->rvp.n_rc_resends += delta_psn(qp->s_psn, psn);
1669 reset_psn(qp, psn);
1674 * This would be psn+1 except when RDMA reads or TID RDMA ops
1677 static void reset_sending_psn(struct rvt_qp *qp, u32 psn)
1686 if (cmp_psn(psn, wqe->lpsn) <= 0) {
1692 qp->s_sending_psn = psn + 1;
1718 u32 psn;
1727 psn = ib_bth_get_psn(ohdr) | IB_BTH_REQ_ACK;
1728 ohdr->bth[2] = cpu_to_be32(psn);
1741 u32 psn;
1759 psn = ib_bth_get_psn(ohdr);
1767 reset_sending_psn(qp, psn);
1799 if ((psn & IB_BTH_REQ_ACK) && tail != head &&
1815 (psn & IB_BTH_REQ_ACK) &&
1846 trace_hfi1_sendcomplete(qp, psn);
1856 static inline void update_last_psn(struct rvt_qp *qp, u32 psn)
1858 qp->s_last_psn = psn;
1931 qp->s_psn = wqe->psn;
1964 * @psn: the packet sequence number of the TID RDMA WRITE RESP.
1965 * @spsn: The start psn for the given TID RDMA WRITE swqe.
1966 * @lpsn: The last psn for the given TID RDMA WRITE swqe.
1972 static void update_qp_retry_state(struct rvt_qp *qp, u32 psn, u32 spsn,
1977 qp->s_psn = psn + 1;
1984 if (cmp_psn(psn, lpsn) >= 0) {
1989 } else if (!cmp_psn(psn, spsn)) {
1998 * @psn: the packet sequence number of the ACK
2006 int do_rc_ack(struct rvt_qp *qp, u32 aeth, u32 psn, int opcode,
2025 ack_psn = psn;
2065 (delta_psn(psn, qp->s_last_psn) != 1))) {
2111 trace_hfi1_rc_ack_do(qp, aeth, psn, wqe);
2146 if (cmp_psn(psn, qp->s_last_psn + 1)) {
2151 * If the psn is being resent, stop the
2155 cmp_psn(qp->s_psn, psn) <= 0)
2156 update_qp_retry_state(qp, psn,
2157 __w->psn,
2174 if (cmp_psn(qp->s_psn, psn) <= 0)
2175 reset_psn(qp, psn + 1);
2180 if (cmp_psn(qp->s_psn, psn) <= 0) {
2182 qp->s_psn = psn + 1;
2199 cmp_psn(psn, wqe->psn) >= 0)
2201 update_last_psn(qp, psn);
2230 update_last_psn(qp, psn - 1);
2231 reset_psn(qp, psn);
2234 ibp->rvp.n_rc_resends += delta_psn(qp->s_psn, psn);
2244 update_last_psn(qp, psn - 1);
2255 hfi1_restart_rc(qp, psn, 0);
2305 static void rdma_seq_err(struct rvt_qp *qp, struct hfi1_ibport *ibp, u32 psn,
2316 while (cmp_psn(psn, wqe->lpsn) > 0) {
2358 u32 psn = ib_bth_get_psn(packet->ohdr);
2366 trace_hfi1_ack(qp, psn);
2369 if (cmp_psn(psn, READ_ONCE(qp->s_next_psn)) >= 0)
2373 diff = cmp_psn(psn, qp->s_last_psn);
2389 if (cmp_psn(psn, qp->s_last_psn + 1) != 0)
2408 if (!do_rc_ack(qp, aeth, psn, opcode, val, rcd) ||
2420 wqe, psn, pmtu);
2425 if (unlikely(cmp_psn(psn, qp->s_last_psn + 1)))
2453 update_last_psn(qp, psn);
2461 if (!do_rc_ack(qp, aeth, psn, opcode, 0, rcd))
2476 wqe, psn, pmtu);
2481 if (unlikely(cmp_psn(psn, qp->s_last_psn + 1)))
2499 (void)do_rc_ack(qp, aeth, psn,
2510 rdma_seq_err(qp, ibp, psn, rcd);
2542 * @psn: the packet sequence number for this packet
2552 struct rvt_qp *qp, u32 opcode, u32 psn,
2562 trace_hfi1_rcv_error(qp, psn);
2606 e = find_prev_entry(qp, psn, &prev, &mra, &old_req);
2629 offset = delta_psn(psn, e->psn) * qp->pmtu;
2648 e->psn = psn;
2677 if (!(psn & IB_BTH_REQ_ACK) || old_req)
2815 u32 psn = ib_bth_get_psn(packet->ohdr);
2848 diff = delta_psn(psn, qp->r_psn);
2850 if (rc_rcv_error(ohdr, data, qp, opcode, psn, diff, rcd))
3100 e->psn = psn;
3176 e->psn = psn;
3177 e->lpsn = psn;
3201 qp->r_ack_psn = psn;
3204 if (psn & IB_BTH_REQ_ACK || fecn) {
3258 u32 psn;
3263 psn = ib_bth_get_psn(packet->ohdr);
3268 diff = delta_psn(psn, qp->r_psn);