@@ -547,14 +547,16 @@ int rxe_completer(void *arg)
547
547
struct sk_buff * skb = NULL ;
548
548
struct rxe_pkt_info * pkt = NULL ;
549
549
enum comp_state state ;
550
+ int ret = 0 ;
550
551
551
552
rxe_add_ref (qp );
552
553
553
554
if (!qp -> valid || qp -> req .state == QP_STATE_ERROR ||
554
555
qp -> req .state == QP_STATE_RESET ) {
555
556
rxe_drain_resp_pkts (qp , qp -> valid &&
556
557
qp -> req .state == QP_STATE_ERROR );
557
- goto exit ;
558
+ ret = - EAGAIN ;
559
+ goto done ;
558
560
}
559
561
560
562
if (qp -> comp .timeout ) {
@@ -564,8 +566,10 @@ int rxe_completer(void *arg)
564
566
qp -> comp .timeout_retry = 0 ;
565
567
}
566
568
567
- if (qp -> req .need_retry )
568
- goto exit ;
569
+ if (qp -> req .need_retry ) {
570
+ ret = - EAGAIN ;
571
+ goto done ;
572
+ }
569
573
570
574
state = COMPST_GET_ACK ;
571
575
@@ -636,8 +640,6 @@ int rxe_completer(void *arg)
636
640
break ;
637
641
638
642
case COMPST_DONE :
639
- if (pkt )
640
- free_pkt (pkt );
641
643
goto done ;
642
644
643
645
case COMPST_EXIT :
@@ -660,7 +662,8 @@ int rxe_completer(void *arg)
660
662
qp -> qp_timeout_jiffies )
661
663
mod_timer (& qp -> retrans_timer ,
662
664
jiffies + qp -> qp_timeout_jiffies );
663
- goto exit ;
665
+ ret = - EAGAIN ;
666
+ goto done ;
664
667
665
668
case COMPST_ERROR_RETRY :
666
669
/* we come here if the retry timer fired and we did
@@ -672,18 +675,18 @@ int rxe_completer(void *arg)
672
675
*/
673
676
674
677
/* there is nothing to retry in this case */
675
- if (!wqe || (wqe -> state == wqe_state_posted ))
676
- goto exit ;
678
+ if (!wqe || (wqe -> state == wqe_state_posted )) {
679
+ pr_warn ("Retry attempted without a valid wqe\n" );
680
+ ret = - EAGAIN ;
681
+ goto done ;
682
+ }
677
683
678
684
/* if we've started a retry, don't start another
679
685
* retry sequence, unless this is a timeout.
680
686
*/
681
687
if (qp -> comp .started_retry &&
682
- !qp -> comp .timeout_retry ) {
683
- if (pkt )
684
- free_pkt (pkt );
688
+ !qp -> comp .timeout_retry )
685
689
goto done ;
686
- }
687
690
688
691
if (qp -> comp .retry_cnt > 0 ) {
689
692
if (qp -> comp .retry_cnt != 7 )
@@ -704,8 +707,6 @@ int rxe_completer(void *arg)
704
707
qp -> comp .started_retry = 1 ;
705
708
rxe_run_task (& qp -> req .task , 0 );
706
709
}
707
- if (pkt )
708
- free_pkt (pkt );
709
710
goto done ;
710
711
711
712
} else {
@@ -726,8 +727,8 @@ int rxe_completer(void *arg)
726
727
mod_timer (& qp -> rnr_nak_timer ,
727
728
jiffies + rnrnak_jiffies (aeth_syn (pkt )
728
729
& ~AETH_TYPE_MASK ));
729
- free_pkt ( pkt ) ;
730
- goto exit ;
730
+ ret = - EAGAIN ;
731
+ goto done ;
731
732
} else {
732
733
rxe_counter_inc (rxe ,
733
734
RXE_CNT_RNR_RETRY_EXCEEDED );
@@ -740,25 +741,15 @@ int rxe_completer(void *arg)
740
741
WARN_ON_ONCE (wqe -> status == IB_WC_SUCCESS );
741
742
do_complete (qp , wqe );
742
743
rxe_qp_error (qp );
743
- if (pkt )
744
- free_pkt (pkt );
745
- goto exit ;
744
+ ret = - EAGAIN ;
745
+ goto done ;
746
746
}
747
747
}
748
748
749
- exit :
750
- /* we come here if we are done with processing and want the task to
751
- * exit from the loop calling us
752
- */
753
- WARN_ON_ONCE (skb );
754
- rxe_drop_ref (qp );
755
- return - EAGAIN ;
756
-
757
749
done :
758
- /* we come here if we have processed a packet we want the task to call
759
- * us again to see if there is anything else to do
760
- */
761
- WARN_ON_ONCE (skb );
750
+ if (pkt )
751
+ free_pkt (pkt );
762
752
rxe_drop_ref (qp );
763
- return 0 ;
753
+
754
+ return ret ;
764
755
}
0 commit comments