]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
IB/rxe: avoid back-to-back retries
authorVijay Immanuel <vijayi@attalasystems.com>
Thu, 14 Jun 2018 01:47:30 +0000 (18:47 -0700)
committerDoug Ledford <dledford@redhat.com>
Thu, 30 Aug 2018 21:27:15 +0000 (17:27 -0400)
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@attalasystems.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/sw/rxe/rxe_comp.c
drivers/infiniband/sw/rxe/rxe_verbs.h

index 83311dd07019b81bb65fbd4aa9810dbc6f352f8e..ed96441595d8135eefb6ab9e2994c9ff7c7fbb7c 100644 (file)
@@ -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,
@@ -676,6 +677,20 @@ int rxe_completer(void *arg)
                                goto exit;
                        }
 
+                       /* if we've started a retry, don't start another
+                        * retry sequence, unless this is a timeout.
+                        */
+                       if (qp->comp.started_retry &&
+                           !qp->comp.timeout_retry) {
+                               if (pkt) {
+                                       rxe_drop_ref(pkt->qp);
+                                       kfree_skb(skb);
+                                       skb = NULL;
+                               }
+
+                               goto done;
+                       }
+
                        if (qp->comp.retry_cnt > 0) {
                                if (qp->comp.retry_cnt != 7)
                                        qp->comp.retry_cnt--;
@@ -692,6 +707,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);
                                }
 
@@ -701,7 +717,7 @@ int rxe_completer(void *arg)
                                        skb = NULL;
                                }
 
-                               goto exit;
+                               goto done;
 
                        } else {
                                rxe_counter_inc(rxe, RXE_CNT_RETRY_EXCEEDED);
index 979e987e3c4640f686b14e7927caba8ed1fb872f..82e670d6eeea3e863c4e651aac04bdb15680beac 100644 (file)
@@ -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;