Lines Matching refs:psn
16 struct rvt_ack_entry *find_prev_entry(struct rvt_qp *qp, u32 psn, u8 *prev,
40 if (cmp_psn(psn, e->psn) >= 0) {
42 cmp_psn(psn, e->lpsn) <= 0)
120 trace_hfi1_rsp_make_rc_ack(qp, e->psn);
170 qp->s_ack_rdma_psn = e->psn;
185 qp->s_ack_rdma_psn = mask_psn(e->psn + req->cur_seg);
219 bth2 = mask_psn(e->psn);
295 trace_hfi1_tid_req_make_rc_ack_write(qp, 0, e->opcode, e->psn,
533 qp->s_psn = wqe->psn;
710 req->comp_seg = delta_psn(bth2, wqe->psn);
723 wqe->psn, wqe->lpsn,
763 wqe->psn, wqe->lpsn,
765 delta = cmp_psn(qp->s_psn, wqe->psn);
991 len = (delta_psn(qp->s_psn, wqe->psn)) * pmtu;
1019 req->comp_seg = delta_psn(qp->s_psn, wqe->psn);
1034 wqe->psn, wqe->lpsn, req);
1044 * Back down. The field qp->s_psn has been set to the psn with
1048 req->cur_seg = delta_psn(qp->s_psn, wqe->psn) / priv->pkts_ps;
1089 wqe->psn, wqe->lpsn, req);
1093 delta = cmp_psn(qp->s_psn, wqe->psn);
1132 wqe->psn, wqe->lpsn, req);
1136 delta = delta_psn(bth2, wqe->psn);
1410 * @psn: the packet sequence number to restart at
1417 static void update_num_rd_atomic(struct rvt_qp *qp, u32 psn,
1430 if (cmp_psn(psn, wqe->lpsn) <= 0) {
1433 cur_seg = (psn - wqe->psn) / priv->pkts_ps;
1439 wqe->psn,
1452 * @psn: the packet sequence number to restart at
1458 static void reset_psn(struct rvt_qp *qp, u32 psn)
1475 if (cmp_psn(psn, wqe->psn) <= 0) {
1479 update_num_rd_atomic(qp, psn, wqe);
1490 diff = cmp_psn(psn, wqe->psn);
1506 update_num_rd_atomic(qp, psn, wqe);
1547 qp->s_psn = psn;
1564 void hfi1_restart_rc(struct rvt_qp *qp, u32 psn, int wait)
1620 ibp->rvp.n_rc_resends += delta_psn(qp->s_psn, psn);
1627 reset_psn(qp, psn);
1632 * This would be psn+1 except when RDMA reads or TID RDMA ops
1635 static void reset_sending_psn(struct rvt_qp *qp, u32 psn)
1644 if (cmp_psn(psn, wqe->lpsn) <= 0) {
1650 qp->s_sending_psn = psn + 1;
1676 u32 psn;
1685 psn = ib_bth_get_psn(ohdr) | IB_BTH_REQ_ACK;
1686 ohdr->bth[2] = cpu_to_be32(psn);
1699 u32 psn;
1717 psn = ib_bth_get_psn(ohdr);
1725 reset_sending_psn(qp, psn);
1757 if ((psn & IB_BTH_REQ_ACK) && tail != head &&
1773 (psn & IB_BTH_REQ_ACK) &&
1804 trace_hfi1_sendcomplete(qp, psn);
1814 static inline void update_last_psn(struct rvt_qp *qp, u32 psn)
1816 qp->s_last_psn = psn;
1889 qp->s_psn = wqe->psn;
1922 * @psn: the packet sequence number of the TID RDMA WRITE RESP.
1923 * @spsn: The start psn for the given TID RDMA WRITE swqe.
1924 * @lpsn: The last psn for the given TID RDMA WRITE swqe.
1930 static void update_qp_retry_state(struct rvt_qp *qp, u32 psn, u32 spsn,
1935 qp->s_psn = psn + 1;
1942 if (cmp_psn(psn, lpsn) >= 0) {
1947 } else if (!cmp_psn(psn, spsn)) {
1956 * @psn: the packet sequence number of the ACK
1964 int do_rc_ack(struct rvt_qp *qp, u32 aeth, u32 psn, int opcode,
1983 ack_psn = psn;
2023 (delta_psn(psn, qp->s_last_psn) != 1))) {
2069 trace_hfi1_rc_ack_do(qp, aeth, psn, wqe);
2104 if (cmp_psn(psn, qp->s_last_psn + 1)) {
2109 * If the psn is being resent, stop the
2113 cmp_psn(qp->s_psn, psn) <= 0)
2114 update_qp_retry_state(qp, psn,
2115 __w->psn,
2132 if (cmp_psn(qp->s_psn, psn) <= 0)
2133 reset_psn(qp, psn + 1);
2138 if (cmp_psn(qp->s_psn, psn) <= 0) {
2140 qp->s_psn = psn + 1;
2157 cmp_psn(psn, wqe->psn) >= 0)
2159 update_last_psn(qp, psn);
2188 update_last_psn(qp, psn - 1);
2189 reset_psn(qp, psn);
2192 ibp->rvp.n_rc_resends += delta_psn(qp->s_psn, psn);
2202 update_last_psn(qp, psn - 1);
2213 hfi1_restart_rc(qp, psn, 0);
2263 static void rdma_seq_err(struct rvt_qp *qp, struct hfi1_ibport *ibp, u32 psn,
2274 while (cmp_psn(psn, wqe->lpsn) > 0) {
2316 u32 psn = ib_bth_get_psn(packet->ohdr);
2324 trace_hfi1_ack(qp, psn);
2327 if (cmp_psn(psn, READ_ONCE(qp->s_next_psn)) >= 0)
2331 diff = cmp_psn(psn, qp->s_last_psn);
2347 if (cmp_psn(psn, qp->s_last_psn + 1) != 0)
2366 if (!do_rc_ack(qp, aeth, psn, opcode, val, rcd) ||
2378 wqe, psn, pmtu);
2383 if (unlikely(cmp_psn(psn, qp->s_last_psn + 1)))
2411 update_last_psn(qp, psn);
2419 if (!do_rc_ack(qp, aeth, psn, opcode, 0, rcd))
2434 wqe, psn, pmtu);
2439 if (unlikely(cmp_psn(psn, qp->s_last_psn + 1)))
2457 (void)do_rc_ack(qp, aeth, psn,
2468 rdma_seq_err(qp, ibp, psn, rcd);
2500 * @psn: the packet sequence number for this packet
2511 struct rvt_qp *qp, u32 opcode, u32 psn,
2521 trace_hfi1_rcv_error(qp, psn);
2565 e = find_prev_entry(qp, psn, &prev, &mra, &old_req);
2588 offset = delta_psn(psn, e->psn) * qp->pmtu;
2607 e->psn = psn;
2636 if (!(psn & IB_BTH_REQ_ACK) || old_req)
2774 u32 psn = ib_bth_get_psn(packet->ohdr);
2807 diff = delta_psn(psn, qp->r_psn);
2809 if (rc_rcv_error(ohdr, data, qp, opcode, psn, diff, rcd))
3059 e->psn = psn;
3135 e->psn = psn;
3136 e->lpsn = psn;
3160 qp->r_ack_psn = psn;
3163 if (psn & IB_BTH_REQ_ACK || fecn) {
3217 u32 psn;
3222 psn = ib_bth_get_psn(packet->ohdr);
3227 diff = delta_psn(psn, qp->r_psn);