@@ -1266,9 +1266,6 @@ static int do_rc_ack(struct rvt_qp *qp, u32 aeth, u32 psn, int opcode,
1266
1266
int diff ;
1267
1267
unsigned long to ;
1268
1268
1269
- /* Remove QP from retry timer */
1270
- hfi1_stop_rc_timers (qp );
1271
-
1272
1269
/*
1273
1270
* Note that NAKs implicitly ACK outstanding SEND and RDMA write
1274
1271
* requests and implicitly NAK RDMA read and atomic requests issued
@@ -1296,7 +1293,7 @@ static int do_rc_ack(struct rvt_qp *qp, u32 aeth, u32 psn, int opcode,
1296
1293
opcode == OP (RDMA_READ_RESPONSE_ONLY ) &&
1297
1294
diff == 0 ) {
1298
1295
ret = 1 ;
1299
- goto bail ;
1296
+ goto bail_stop ;
1300
1297
}
1301
1298
/*
1302
1299
* If this request is a RDMA read or atomic, and the ACK is
@@ -1327,7 +1324,7 @@ static int do_rc_ack(struct rvt_qp *qp, u32 aeth, u32 psn, int opcode,
1327
1324
* No need to process the ACK/NAK since we are
1328
1325
* restarting an earlier request.
1329
1326
*/
1330
- goto bail ;
1327
+ goto bail_stop ;
1331
1328
}
1332
1329
if (wqe -> wr .opcode == IB_WR_ATOMIC_CMP_AND_SWP ||
1333
1330
wqe -> wr .opcode == IB_WR_ATOMIC_FETCH_AND_ADD ) {
@@ -1362,18 +1359,22 @@ static int do_rc_ack(struct rvt_qp *qp, u32 aeth, u32 psn, int opcode,
1362
1359
if (qp -> s_acked != qp -> s_tail ) {
1363
1360
/*
1364
1361
* We are expecting more ACKs so
1365
- * reset the re-transmit timer.
1362
+ * mod the retry timer.
1366
1363
*/
1367
- hfi1_add_retry_timer (qp );
1364
+ hfi1_mod_retry_timer (qp );
1368
1365
/*
1369
1366
* We can stop re-sending the earlier packets and
1370
1367
* continue with the next packet the receiver wants.
1371
1368
*/
1372
1369
if (cmp_psn (qp -> s_psn , psn ) <= 0 )
1373
1370
reset_psn (qp , psn + 1 );
1374
- } else if (cmp_psn (qp -> s_psn , psn ) <= 0 ) {
1375
- qp -> s_state = OP (SEND_LAST );
1376
- qp -> s_psn = psn + 1 ;
1371
+ } else {
1372
+ /* No more acks - kill all timers */
1373
+ hfi1_stop_rc_timers (qp );
1374
+ if (cmp_psn (qp -> s_psn , psn ) <= 0 ) {
1375
+ qp -> s_state = OP (SEND_LAST );
1376
+ qp -> s_psn = psn + 1 ;
1377
+ }
1377
1378
}
1378
1379
if (qp -> s_flags & RVT_S_WAIT_ACK ) {
1379
1380
qp -> s_flags &= ~RVT_S_WAIT_ACK ;
@@ -1383,15 +1384,14 @@ static int do_rc_ack(struct rvt_qp *qp, u32 aeth, u32 psn, int opcode,
1383
1384
qp -> s_rnr_retry = qp -> s_rnr_retry_cnt ;
1384
1385
qp -> s_retry = qp -> s_retry_cnt ;
1385
1386
update_last_psn (qp , psn );
1386
- ret = 1 ;
1387
- goto bail ;
1387
+ return 1 ;
1388
1388
1389
1389
case 1 : /* RNR NAK */
1390
1390
ibp -> rvp .n_rnr_naks ++ ;
1391
1391
if (qp -> s_acked == qp -> s_tail )
1392
- goto bail ;
1392
+ goto bail_stop ;
1393
1393
if (qp -> s_flags & RVT_S_WAIT_RNR )
1394
- goto bail ;
1394
+ goto bail_stop ;
1395
1395
if (qp -> s_rnr_retry == 0 ) {
1396
1396
status = IB_WC_RNR_RETRY_EXC_ERR ;
1397
1397
goto class_b ;
@@ -1407,15 +1407,16 @@ static int do_rc_ack(struct rvt_qp *qp, u32 aeth, u32 psn, int opcode,
1407
1407
reset_psn (qp , psn );
1408
1408
1409
1409
qp -> s_flags &= ~(RVT_S_WAIT_SSN_CREDIT | RVT_S_WAIT_ACK );
1410
+ hfi1_stop_rc_timers (qp );
1410
1411
to =
1411
1412
ib_hfi1_rnr_table [(aeth >> HFI1_AETH_CREDIT_SHIFT ) &
1412
1413
HFI1_AETH_CREDIT_MASK ];
1413
1414
hfi1_add_rnr_timer (qp , to );
1414
- goto bail ;
1415
+ return 0 ;
1415
1416
1416
1417
case 3 : /* NAK */
1417
1418
if (qp -> s_acked == qp -> s_tail )
1418
- goto bail ;
1419
+ goto bail_stop ;
1419
1420
/* The last valid PSN is the previous PSN. */
1420
1421
update_last_psn (qp , psn - 1 );
1421
1422
switch ((aeth >> HFI1_AETH_CREDIT_SHIFT ) &
@@ -1458,15 +1459,16 @@ static int do_rc_ack(struct rvt_qp *qp, u32 aeth, u32 psn, int opcode,
1458
1459
}
1459
1460
qp -> s_retry = qp -> s_retry_cnt ;
1460
1461
qp -> s_rnr_retry = qp -> s_rnr_retry_cnt ;
1461
- goto bail ;
1462
+ goto bail_stop ;
1462
1463
1463
1464
default : /* 2: reserved */
1464
1465
reserved :
1465
1466
/* Ignore reserved NAK codes. */
1466
- goto bail ;
1467
+ goto bail_stop ;
1467
1468
}
1468
-
1469
- bail :
1469
+ return ret ;
1470
+ bail_stop :
1471
+ hfi1_stop_rc_timers (qp );
1470
1472
return ret ;
1471
1473
}
1472
1474
0 commit comments