Lines Matching refs:psn
16 struct rvt_ack_entry *find_prev_entry(struct rvt_qp *qp, u32 psn, u8 *prev, in find_prev_entry() argument
40 if (cmp_psn(psn, e->psn) >= 0) { in find_prev_entry()
42 cmp_psn(psn, e->lpsn) <= 0) in find_prev_entry()
120 trace_hfi1_rsp_make_rc_ack(qp, e->psn); in make_rc_ack()
170 qp->s_ack_rdma_psn = e->psn; in make_rc_ack()
185 qp->s_ack_rdma_psn = mask_psn(e->psn + req->cur_seg); in make_rc_ack()
219 bth2 = mask_psn(e->psn); in make_rc_ack()
295 trace_hfi1_tid_req_make_rc_ack_write(qp, 0, e->opcode, e->psn, in make_rc_ack()
533 qp->s_psn = wqe->psn; in hfi1_make_rc_req()
710 req->comp_seg = delta_psn(bth2, wqe->psn); in hfi1_make_rc_req()
723 wqe->psn, wqe->lpsn, in hfi1_make_rc_req()
763 wqe->psn, wqe->lpsn, in hfi1_make_rc_req()
765 delta = cmp_psn(qp->s_psn, wqe->psn); in hfi1_make_rc_req()
991 len = (delta_psn(qp->s_psn, wqe->psn)) * pmtu; in hfi1_make_rc_req()
1019 req->comp_seg = delta_psn(qp->s_psn, wqe->psn); in hfi1_make_rc_req()
1034 wqe->psn, wqe->lpsn, req); in hfi1_make_rc_req()
1048 req->cur_seg = delta_psn(qp->s_psn, wqe->psn) / priv->pkts_ps; in hfi1_make_rc_req()
1089 wqe->psn, wqe->lpsn, req); in hfi1_make_rc_req()
1093 delta = cmp_psn(qp->s_psn, wqe->psn); in hfi1_make_rc_req()
1132 wqe->psn, wqe->lpsn, req); in hfi1_make_rc_req()
1136 delta = delta_psn(bth2, wqe->psn); in hfi1_make_rc_req()
1417 static void update_num_rd_atomic(struct rvt_qp *qp, u32 psn, in update_num_rd_atomic() argument
1430 if (cmp_psn(psn, wqe->lpsn) <= 0) { in update_num_rd_atomic()
1433 cur_seg = (psn - wqe->psn) / priv->pkts_ps; in update_num_rd_atomic()
1439 wqe->psn, in update_num_rd_atomic()
1458 static void reset_psn(struct rvt_qp *qp, u32 psn) in reset_psn() argument
1475 if (cmp_psn(psn, wqe->psn) <= 0) { in reset_psn()
1479 update_num_rd_atomic(qp, psn, wqe); in reset_psn()
1490 diff = cmp_psn(psn, wqe->psn); in reset_psn()
1506 update_num_rd_atomic(qp, psn, wqe); in reset_psn()
1547 qp->s_psn = psn; in reset_psn()
1564 void hfi1_restart_rc(struct rvt_qp *qp, u32 psn, int wait) in hfi1_restart_rc() argument
1620 ibp->rvp.n_rc_resends += delta_psn(qp->s_psn, psn); in hfi1_restart_rc()
1627 reset_psn(qp, psn); in hfi1_restart_rc()
1635 static void reset_sending_psn(struct rvt_qp *qp, u32 psn) in reset_sending_psn() argument
1644 if (cmp_psn(psn, wqe->lpsn) <= 0) { in reset_sending_psn()
1650 qp->s_sending_psn = psn + 1; in reset_sending_psn()
1676 u32 psn; in hfi1_rc_verbs_aborted() local
1685 psn = ib_bth_get_psn(ohdr) | IB_BTH_REQ_ACK; in hfi1_rc_verbs_aborted()
1686 ohdr->bth[2] = cpu_to_be32(psn); in hfi1_rc_verbs_aborted()
1699 u32 psn; in hfi1_rc_send_complete() local
1717 psn = ib_bth_get_psn(ohdr); in hfi1_rc_send_complete()
1725 reset_sending_psn(qp, psn); in hfi1_rc_send_complete()
1757 if ((psn & IB_BTH_REQ_ACK) && tail != head && in hfi1_rc_send_complete()
1773 (psn & IB_BTH_REQ_ACK) && in hfi1_rc_send_complete()
1804 trace_hfi1_sendcomplete(qp, psn); in hfi1_rc_send_complete()
1814 static inline void update_last_psn(struct rvt_qp *qp, u32 psn) in update_last_psn() argument
1816 qp->s_last_psn = psn; in update_last_psn()
1889 qp->s_psn = wqe->psn; in do_rc_completion()
1930 static void update_qp_retry_state(struct rvt_qp *qp, u32 psn, u32 spsn, in update_qp_retry_state() argument
1935 qp->s_psn = psn + 1; in update_qp_retry_state()
1942 if (cmp_psn(psn, lpsn) >= 0) { in update_qp_retry_state()
1947 } else if (!cmp_psn(psn, spsn)) { in update_qp_retry_state()
1964 int do_rc_ack(struct rvt_qp *qp, u32 aeth, u32 psn, int opcode, in do_rc_ack() argument
1983 ack_psn = psn; in do_rc_ack()
2023 (delta_psn(psn, qp->s_last_psn) != 1))) { in do_rc_ack()
2069 trace_hfi1_rc_ack_do(qp, aeth, psn, wqe); in do_rc_ack()
2104 if (cmp_psn(psn, qp->s_last_psn + 1)) { in do_rc_ack()
2113 cmp_psn(qp->s_psn, psn) <= 0) in do_rc_ack()
2114 update_qp_retry_state(qp, psn, in do_rc_ack()
2115 __w->psn, in do_rc_ack()
2132 if (cmp_psn(qp->s_psn, psn) <= 0) in do_rc_ack()
2133 reset_psn(qp, psn + 1); in do_rc_ack()
2138 if (cmp_psn(qp->s_psn, psn) <= 0) { in do_rc_ack()
2140 qp->s_psn = psn + 1; in do_rc_ack()
2157 cmp_psn(psn, wqe->psn) >= 0) in do_rc_ack()
2159 update_last_psn(qp, psn); in do_rc_ack()
2188 update_last_psn(qp, psn - 1); in do_rc_ack()
2189 reset_psn(qp, psn); in do_rc_ack()
2192 ibp->rvp.n_rc_resends += delta_psn(qp->s_psn, psn); in do_rc_ack()
2202 update_last_psn(qp, psn - 1); in do_rc_ack()
2213 hfi1_restart_rc(qp, psn, 0); in do_rc_ack()
2263 static void rdma_seq_err(struct rvt_qp *qp, struct hfi1_ibport *ibp, u32 psn, in rdma_seq_err() argument
2274 while (cmp_psn(psn, wqe->lpsn) > 0) { in rdma_seq_err()
2316 u32 psn = ib_bth_get_psn(packet->ohdr); in rc_rcv_resp() local
2324 trace_hfi1_ack(qp, psn); in rc_rcv_resp()
2327 if (cmp_psn(psn, READ_ONCE(qp->s_next_psn)) >= 0) in rc_rcv_resp()
2331 diff = cmp_psn(psn, qp->s_last_psn); in rc_rcv_resp()
2347 if (cmp_psn(psn, qp->s_last_psn + 1) != 0) in rc_rcv_resp()
2366 if (!do_rc_ack(qp, aeth, psn, opcode, val, rcd) || in rc_rcv_resp()
2378 wqe, psn, pmtu); in rc_rcv_resp()
2383 if (unlikely(cmp_psn(psn, qp->s_last_psn + 1))) in rc_rcv_resp()
2411 update_last_psn(qp, psn); in rc_rcv_resp()
2419 if (!do_rc_ack(qp, aeth, psn, opcode, 0, rcd)) in rc_rcv_resp()
2434 wqe, psn, pmtu); in rc_rcv_resp()
2439 if (unlikely(cmp_psn(psn, qp->s_last_psn + 1))) in rc_rcv_resp()
2457 (void)do_rc_ack(qp, aeth, psn, in rc_rcv_resp()
2468 rdma_seq_err(qp, ibp, psn, rcd); in rc_rcv_resp()
2511 struct rvt_qp *qp, u32 opcode, u32 psn, in rc_rcv_error() argument
2521 trace_hfi1_rcv_error(qp, psn); in rc_rcv_error()
2565 e = find_prev_entry(qp, psn, &prev, &mra, &old_req); in rc_rcv_error()
2588 offset = delta_psn(psn, e->psn) * qp->pmtu; in rc_rcv_error()
2607 e->psn = psn; in rc_rcv_error()
2636 if (!(psn & IB_BTH_REQ_ACK) || old_req) in rc_rcv_error()
2774 u32 psn = ib_bth_get_psn(packet->ohdr); in hfi1_rc_rcv() local
2807 diff = delta_psn(psn, qp->r_psn); in hfi1_rc_rcv()
2809 if (rc_rcv_error(ohdr, data, qp, opcode, psn, diff, rcd)) in hfi1_rc_rcv()
3059 e->psn = psn; in hfi1_rc_rcv()
3135 e->psn = psn; in hfi1_rc_rcv()
3136 e->lpsn = psn; in hfi1_rc_rcv()
3160 qp->r_ack_psn = psn; in hfi1_rc_rcv()
3163 if (psn & IB_BTH_REQ_ACK || fecn) { in hfi1_rc_rcv()
3217 u32 psn; in hfi1_rc_hdrerr() local
3222 psn = ib_bth_get_psn(packet->ohdr); in hfi1_rc_hdrerr()
3227 diff = delta_psn(psn, qp->r_psn); in hfi1_rc_hdrerr()