@@ -183,15 +183,6 @@ static u32 restart_sge(struct rvt_sge_state *ss, struct rvt_swqe *wqe,
183
183
return wqe -> length - len ;
184
184
}
185
185
186
- static void start_timer (struct rvt_qp * qp )
187
- {
188
- qp -> s_flags |= RVT_S_TIMER ;
189
- qp -> s_timer .function = rc_timeout ;
190
- /* 4.096 usec. * (1 << qp->timeout) */
191
- qp -> s_timer .expires = jiffies + qp -> timeout_jiffies ;
192
- add_timer (& qp -> s_timer );
193
- }
194
-
195
186
/**
196
187
* make_rc_ack - construct a response packet (ACK, NAK, or RDMA read)
197
188
* @dev: the device for this QP
@@ -1054,11 +1045,8 @@ void hfi1_rc_rnr_retry(unsigned long arg)
1054
1045
unsigned long flags ;
1055
1046
1056
1047
spin_lock_irqsave (& qp -> s_lock , flags );
1057
- if (qp -> s_flags & RVT_S_WAIT_RNR ) {
1058
- qp -> s_flags &= ~RVT_S_WAIT_RNR ;
1059
- del_timer (& qp -> s_timer );
1060
- hfi1_schedule_send (qp );
1061
- }
1048
+ hfi1_stop_rnr_timer (qp );
1049
+ hfi1_schedule_send (qp );
1062
1050
spin_unlock_irqrestore (& qp -> s_lock , flags );
1063
1051
}
1064
1052
@@ -1128,7 +1116,7 @@ void hfi1_rc_send_complete(struct rvt_qp *qp, struct hfi1_ib_header *hdr)
1128
1116
!(qp -> s_flags &
1129
1117
(RVT_S_TIMER | RVT_S_WAIT_RNR | RVT_S_WAIT_PSN )) &&
1130
1118
(ib_rvt_state_ops [qp -> state ] & RVT_PROCESS_RECV_OK ))
1131
- start_timer (qp );
1119
+ hfi1_add_retry_timer (qp );
1132
1120
1133
1121
while (qp -> s_last != qp -> s_acked ) {
1134
1122
wqe = rvt_get_swqe_ptr (qp , qp -> s_last );
@@ -1276,12 +1264,10 @@ static int do_rc_ack(struct rvt_qp *qp, u32 aeth, u32 psn, int opcode,
1276
1264
int ret = 0 ;
1277
1265
u32 ack_psn ;
1278
1266
int diff ;
1267
+ unsigned long to ;
1279
1268
1280
1269
/* Remove QP from retry timer */
1281
- if (qp -> s_flags & (RVT_S_TIMER | RVT_S_WAIT_RNR )) {
1282
- qp -> s_flags &= ~(RVT_S_TIMER | RVT_S_WAIT_RNR );
1283
- del_timer (& qp -> s_timer );
1284
- }
1270
+ hfi1_stop_rc_timers (qp );
1285
1271
1286
1272
/*
1287
1273
* Note that NAKs implicitly ACK outstanding SEND and RDMA write
@@ -1378,7 +1364,7 @@ static int do_rc_ack(struct rvt_qp *qp, u32 aeth, u32 psn, int opcode,
1378
1364
* We are expecting more ACKs so
1379
1365
* reset the re-transmit timer.
1380
1366
*/
1381
- start_timer (qp );
1367
+ hfi1_add_retry_timer (qp );
1382
1368
/*
1383
1369
* We can stop re-sending the earlier packets and
1384
1370
* continue with the next packet the receiver wants.
@@ -1421,12 +1407,10 @@ static int do_rc_ack(struct rvt_qp *qp, u32 aeth, u32 psn, int opcode,
1421
1407
reset_psn (qp , psn );
1422
1408
1423
1409
qp -> s_flags &= ~(RVT_S_WAIT_SSN_CREDIT | RVT_S_WAIT_ACK );
1424
- qp -> s_flags |= RVT_S_WAIT_RNR ;
1425
- qp -> s_timer .function = hfi1_rc_rnr_retry ;
1426
- qp -> s_timer .expires = jiffies + usecs_to_jiffies (
1410
+ to =
1427
1411
ib_hfi1_rnr_table [(aeth >> HFI1_AETH_CREDIT_SHIFT ) &
1428
- HFI1_AETH_CREDIT_MASK ]) ;
1429
- add_timer ( & qp -> s_timer );
1412
+ HFI1_AETH_CREDIT_MASK ];
1413
+ hfi1_add_rnr_timer ( qp , to );
1430
1414
goto bail ;
1431
1415
1432
1416
case 3 : /* NAK */
@@ -1496,10 +1480,7 @@ static void rdma_seq_err(struct rvt_qp *qp, struct hfi1_ibport *ibp, u32 psn,
1496
1480
struct rvt_swqe * wqe ;
1497
1481
1498
1482
/* Remove QP from retry timer */
1499
- if (qp -> s_flags & (RVT_S_TIMER | RVT_S_WAIT_RNR )) {
1500
- qp -> s_flags &= ~(RVT_S_TIMER | RVT_S_WAIT_RNR );
1501
- del_timer (& qp -> s_timer );
1502
- }
1483
+ hfi1_stop_rc_timers (qp );
1503
1484
1504
1485
wqe = rvt_get_swqe_ptr (qp , qp -> s_acked );
1505
1486
0 commit comments