From patchwork Tue Jun 10 14:02:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selvin Xavier X-Patchwork-Id: 4328991 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3E901BEEAA for ; Tue, 10 Jun 2014 14:05:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7A602202EC for ; Tue, 10 Jun 2014 14:05:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5642B202EB for ; Tue, 10 Jun 2014 14:05:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751979AbaFJOFG (ORCPT ); Tue, 10 Jun 2014 10:05:06 -0400 Received: from cmexedge2.ext.emulex.com ([138.239.224.100]:30844 "EHLO CMEXEDGE2.ext.emulex.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752117AbaFJOFF (ORCPT ); Tue, 10 Jun 2014 10:05:05 -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; Tue, 10 Jun 2014 07:05:56 -0700 Received: from localhost.localdomain (10.192.201.1) by smtp.emulex.com (138.239.115.207) with Microsoft SMTP Server id 14.3.174.1; Tue, 10 Jun 2014 07:05:00 -0700 From: Selvin Xavier To: CC: , Selvin Xavier , "Devesh Sharma" Subject: [PATCH v1 for-next 08/16] RDMA/ocrdma: Avoid reporting wrong completions in case of error CQEs Date: Tue, 10 Jun 2014 19:32:19 +0530 X-Mailer: git-send-email 1.6.0.2 In-Reply-To: <1402408947-2074-8-git-send-email-selvin.xavier@emulex.com> References: <1402408947-2074-1-git-send-email-selvin.xavier@emulex.com> <1402408947-2074-2-git-send-email-selvin.xavier@emulex.com> <1402408947-2074-3-git-send-email-selvin.xavier@emulex.com> <1402408947-2074-4-git-send-email-selvin.xavier@emulex.com> <1402408947-2074-5-git-send-email-selvin.xavier@emulex.com> <1402408947-2074-6-git-send-email-selvin.xavier@emulex.com> <1402408947-2074-7-git-send-email-selvin.xavier@emulex.com> <1402408947-2074-8-git-send-email-selvin.xavier@emulex.com> MIME-Version: 1.0 Message-ID: Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 During cable pull test with a mount over nfs rdma, driver was reporting error completions when there was no pending requests in the SQ and RQ. This was triggering a host crash because of reporting wrong work req id. Avoid this crash by adding a check for SQ and RQ empty condition and prevent reporting completions if queues are empty. Signed-off-by: Selvin Xavier Signed-off-by: Devesh Sharma --- drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c index 0d7d808..2b68235 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c @@ -2489,6 +2489,11 @@ static bool ocrdma_poll_err_scqe(struct ocrdma_qp *qp, *stop = true; expand = false; } + } else if (is_hw_sq_empty(qp)) { + /* Do nothing */ + expand = false; + *polled = false; + *stop = false; } else { *polled = true; expand = ocrdma_update_err_scqe(ibwc, cqe, qp, status); @@ -2594,6 +2599,11 @@ static bool ocrdma_poll_err_rcqe(struct ocrdma_qp *qp, struct ocrdma_cqe *cqe, *stop = true; expand = false; } + } else if (is_hw_rq_empty(qp)) { + /* Do nothing */ + expand = false; + *polled = false; + *stop = false; } else { *polled = true; expand = ocrdma_update_err_rcqe(ibwc, cqe, qp, status);