From: Selvin Xavier <[email protected]>

The cq polling logic was hitting an infinite loop while generating
flush completions for a torn down QP. This patch adds a check in
flush completion logic to detect SQ/RQ empty condition and stop
polling loop.

Signed-off-by: Devesh Sharma <[email protected]>
Signed-off-by: Selvin Xavier <[email protected]>
---
 src/ocrdma_verbs.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/ocrdma_verbs.c b/src/ocrdma_verbs.c
index a5b7252..edff8b6 100644
--- a/src/ocrdma_verbs.c
+++ b/src/ocrdma_verbs.c
@@ -1739,6 +1739,11 @@ static int ocrdma_poll_err_scqe(struct ocrdma_qp *qp,
                        *stop = 1;
                        expand = 0;
                }
+       } else if (is_hw_sq_empty(qp)) {
+               /* Do nothing */
+               expand = 0;
+               *polled = 0;
+               *stop = 0;
        } else {
                *polled = 1;
                expand = ocrdma_update_err_scqe(ibwc, cqe, qp, status);
@@ -1848,6 +1853,11 @@ static int ocrdma_poll_err_rcqe(struct ocrdma_qp *qp, 
struct ocrdma_cqe *cqe,
                        *stop = 1;
                        expand = 0;
                }
+       } else if (is_hw_rq_empty(qp)) {
+               /* Do nothing */
+               expand = 0;
+               *polled = 0;
+               *stop = 0;
        } else {
                *polled = 1;
                expand = ocrdma_update_err_rcqe(ibwc, cqe, qp, status);
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to