From patchwork Tue Jul 1 05:54:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Devesh Sharma X-Patchwork-Id: 4456721 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id F287F9F3E3 for ; Tue, 1 Jul 2014 06:30:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0A3C3203F4 for ; Tue, 1 Jul 2014 06:30:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9821120411 for ; Tue, 1 Jul 2014 06:30:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752003AbaGAGag (ORCPT ); Tue, 1 Jul 2014 02:30:36 -0400 Received: from cmexedge2.ext.emulex.com ([138.239.224.100]:41617 "EHLO CMEXEDGE2.ext.emulex.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752034AbaGAGaf (ORCPT ); Tue, 1 Jul 2014 02:30:35 -0400 Received: from CMEXHTCAS1.ad.emulex.com (138.239.115.217) by CMEXEDGE2.ext.emulex.com (138.239.224.100) with Microsoft SMTP Server (TLS) id 14.3.174.1; Mon, 30 Jun 2014 23:30:37 -0700 Received: from neo01-el64.lab.bg.emulex.com (10.192.204.8) by smtp.emulex.com (138.239.115.207) with Microsoft SMTP Server id 14.3.174.1; Mon, 30 Jun 2014 23:30:30 -0700 From: Devesh Sharma To: CC: Selvin Xavier , Devesh Sharma Subject: [for-next 3/4] RDMA/libocrdma: stop polling when SQ/RQ is empty Date: Tue, 1 Jul 2014 11:24:04 +0530 X-Mailer: git-send-email 1.7.1 In-Reply-To: <1404194045-26900-1-git-send-email-devesh.sharma@emulex.com> References: <1404194045-26900-1-git-send-email-devesh.sharma@emulex.com> MIME-Version: 1.0 Message-ID: <25d7e82e-650e-4e10-8048-b310ffcfeaa6@CMEXHTCAS1.ad.emulex.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Selvin Xavier 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 Signed-off-by: Selvin Xavier --- 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);