On Mon, Sep 03, 2018 at 06:19:38PM +0800, Yanjun Zhu wrote: > > > On 2018/6/14 9:47, Vijay Immanuel wrote: > >Error retries can occur due to timeouts, NAKs or receiving > >packets beyond the current read request. Avoid back-to-back > >retries due to packet processing, by only retrying the initial > >attempt immediately. Subsequent retries must be due to timeouts. > > > >Continue to process completion packets after scheduling a retry. > > > >Signed-off-by: Vijay Immanuel <vijayi@xxxxxxxxxxxxxxxxx> > >--- > > drivers/infiniband/sw/rxe/rxe_comp.c | 19 ++++++++++++++++++- > > drivers/infiniband/sw/rxe/rxe_verbs.h | 1 + > > 2 files changed, 19 insertions(+), 1 deletion(-) > > > >diff --git a/drivers/infiniband/sw/rxe/rxe_comp.c b/drivers/infiniband/sw/rxe/rxe_comp.c > >index 6cdc40e..b1d5624 100644 > >--- a/drivers/infiniband/sw/rxe/rxe_comp.c > >+++ b/drivers/infiniband/sw/rxe/rxe_comp.c > >@@ -191,6 +191,7 @@ static inline void reset_retry_counters(struct rxe_qp *qp) > > { > > qp->comp.retry_cnt = qp->attr.retry_cnt; > > qp->comp.rnr_retry = qp->attr.rnr_retry; > >+ qp->comp.started_retry = 0; > > } > > static inline enum comp_state check_psn(struct rxe_qp *qp, > >@@ -679,6 +680,21 @@ int rxe_completer(void *arg) > > goto exit; > > } > >+ /* if we've started a retry, don't start another > >+ * retry sequence, unless this is a timeout. > >+ */ > > Sorry. Is it possible that several SKBs require retry at almost the same > time? > Yes, they will all get retried. We only need to set the qp->req.need_retry once. rxe_requester() will retry the send queue, when it sees that flag. > >+ if (qp->comp.started_retry && > >+ !qp->comp.timeout_retry) { > >+ if (pkt) { > >+ rxe_drop_ref(pkt->qp); > >+ kfree_skb(skb); > >+ skb = NULL; > >+ } > >+ > >+ WARN_ON_ONCE(skb); > >+ goto done; > >+ } > >+ > > if (qp->comp.retry_cnt > 0) { > > if (qp->comp.retry_cnt != 7) > > qp->comp.retry_cnt--; > >@@ -695,6 +711,7 @@ int rxe_completer(void *arg) > > rxe_counter_inc(rxe, > > RXE_CNT_COMP_RETRY); > > qp->req.need_retry = 1; > >+ qp->comp.started_retry = 1; > > rxe_run_task(&qp->req.task, 1); > > } > >@@ -705,7 +722,7 @@ int rxe_completer(void *arg) > > } > > WARN_ON_ONCE(skb); > >- goto exit; > >+ goto done; > > } else { > > rxe_counter_inc(rxe, RXE_CNT_RETRY_EXCEEDED); > >diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.h b/drivers/infiniband/sw/rxe/rxe_verbs.h > >index af1470d..51a515b 100644 > >--- a/drivers/infiniband/sw/rxe/rxe_verbs.h > >+++ b/drivers/infiniband/sw/rxe/rxe_verbs.h > >@@ -158,6 +158,7 @@ struct rxe_comp_info { > > int opcode; > > int timeout; > > int timeout_retry; > >+ int started_retry; > > u32 retry_cnt; > > u32 rnr_retry; > > struct rxe_task task; >