@@ -128,6 +128,7 @@ static int make_tid_rdma_ack(struct rvt_qp *qp,
128
128
struct ib_other_headers * ohdr ,
129
129
struct hfi1_pkt_state * ps );
130
130
static void hfi1_do_tid_send (struct rvt_qp * qp );
131
+ static u32 read_r_next_psn (struct hfi1_devdata * dd , u8 ctxt , u8 fidx );
131
132
132
133
static u64 tid_rdma_opfn_encode (struct tid_rdma_params * p )
133
134
{
@@ -2807,18 +2808,10 @@ static bool handle_read_kdeth_eflags(struct hfi1_ctxtdata *rcd,
2807
2808
}
2808
2809
priv -> flow_state .r_next_psn ++ ;
2809
2810
} else {
2810
- u64 reg ;
2811
2811
u32 last_psn ;
2812
2812
2813
- /*
2814
- * The only sane way to get the amount of
2815
- * progress is to read the HW flow state.
2816
- */
2817
- reg = read_uctxt_csr (dd , rcd -> ctxt ,
2818
- RCV_TID_FLOW_TABLE +
2819
- (8 * flow -> idx ));
2820
- last_psn = mask_psn (reg );
2821
-
2813
+ last_psn = read_r_next_psn (dd , rcd -> ctxt ,
2814
+ flow -> idx );
2822
2815
priv -> flow_state .r_next_psn = last_psn ;
2823
2816
priv -> flow_state .flags |= TID_FLOW_SW_PSN ;
2824
2817
/*
@@ -2968,17 +2961,10 @@ bool hfi1_handle_kdeth_eflags(struct hfi1_ctxtdata *rcd,
2968
2961
switch (rte ) {
2969
2962
case RHF_RTE_EXPECTED_FLOW_SEQ_ERR :
2970
2963
if (!(qpriv -> s_flags & HFI1_R_TID_SW_PSN )) {
2971
- u64 reg ;
2972
-
2973
2964
qpriv -> s_flags |= HFI1_R_TID_SW_PSN ;
2974
- /*
2975
- * The only sane way to get the amount of
2976
- * progress is to read the HW flow state.
2977
- */
2978
- reg = read_uctxt_csr (dd , rcd -> ctxt ,
2979
- RCV_TID_FLOW_TABLE +
2980
- (8 * flow -> idx ));
2981
- flow -> flow_state .r_next_psn = mask_psn (reg );
2965
+ flow -> flow_state .r_next_psn =
2966
+ read_r_next_psn (dd , rcd -> ctxt ,
2967
+ flow -> idx );
2982
2968
qpriv -> r_next_psn_kdeth =
2983
2969
flow -> flow_state .r_next_psn ;
2984
2970
goto nak_psn ;
@@ -5456,3 +5442,15 @@ bool hfi1_tid_rdma_ack_interlock(struct rvt_qp *qp, struct rvt_ack_entry *e)
5456
5442
}
5457
5443
return false;
5458
5444
}
5445
+
5446
+ static u32 read_r_next_psn (struct hfi1_devdata * dd , u8 ctxt , u8 fidx )
5447
+ {
5448
+ u64 reg ;
5449
+
5450
+ /*
5451
+ * The only sane way to get the amount of
5452
+ * progress is to read the HW flow state.
5453
+ */
5454
+ reg = read_uctxt_csr (dd , ctxt , RCV_TID_FLOW_TABLE + (8 * fidx ));
5455
+ return mask_psn (reg );
5456
+ }
0 commit comments