From patchwork Fri Aug 17 14:45:33 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Parav Pandit X-Patchwork-Id: 1338381 X-Patchwork-Delegate: roland@digitalvampire.org Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 7A780DF266 for ; Fri, 17 Aug 2012 10:43:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757854Ab2HQKnA (ORCPT ); Fri, 17 Aug 2012 06:43:00 -0400 Received: from cmexedge1.ext.emulex.com ([138.239.224.99]:29278 "EHLO CMEXEDGE1.ext.emulex.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757856Ab2HQKm5 (ORCPT ); Fri, 17 Aug 2012 06:42:57 -0400 Received: from exht1.ad.emulex.com (138.239.113.183) by CMEXEDGE1.ext.emulex.com (138.239.224.99) with Microsoft SMTP Server (TLS) id 14.2.283.3; Fri, 17 Aug 2012 03:43:30 -0700 Received: from localhost.localdomain (10.192.199.176) by exht1.ad.emulex.com (138.239.113.183) with Microsoft SMTP Server id 8.3.159.2; Fri, 17 Aug 2012 03:42:51 -0700 From: Parav Pandit To: CC: Parav Pandit Subject: [PATCH] RDMA/ocrdma: Fixed cqe expansion of unsignaled wqe Date: Fri, 17 Aug 2012 20:15:33 +0530 X-Mailer: git-send-email 1.6.0.2 MIME-Version: 1.0 Message-ID: <1a7e463d-c208-4695-beb8-1a6b3100c3d1@exht1.ad.emulex.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Fixed cqe expansion of unsignaled wqe - stop expanding the cqe when wqe index of the completed cqe matches with last pending wqe (tail) in the queue. Signed-off-by: Parav Pandit --- drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c index cb5b7f7..b29a424 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c @@ -2219,7 +2219,6 @@ static bool ocrdma_poll_success_scqe(struct ocrdma_qp *qp, u32 wqe_idx; if (!qp->wqe_wr_id_tbl[tail].signaled) { - expand = true; /* CQE cannot be consumed yet */ *polled = false; /* WC cannot be consumed yet */ } else { ibwc->status = IB_WC_SUCCESS; @@ -2227,10 +2226,11 @@ static bool ocrdma_poll_success_scqe(struct ocrdma_qp *qp, ibwc->qp = &qp->ibqp; ocrdma_update_wc(qp, ibwc, tail); *polled = true; - wqe_idx = le32_to_cpu(cqe->wq.wqeidx) & OCRDMA_CQE_WQEIDX_MASK; - if (tail != wqe_idx) - expand = true; /* Coalesced CQE can't be consumed yet */ } + wqe_idx = le32_to_cpu(cqe->wq.wqeidx) & OCRDMA_CQE_WQEIDX_MASK; + if (tail != wqe_idx) + expand = true; /* Coalesced CQE can't be consumed yet */ + ocrdma_hwq_inc_tail(&qp->sq); return expand; }