From patchwork Thu Dec 24 18:14:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Devesh Sharma X-Patchwork-Id: 7919811 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 368459F716 for ; Thu, 24 Dec 2015 18:31:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A70AA2046F for ; Thu, 24 Dec 2015 18:31:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AC6062047C for ; Thu, 24 Dec 2015 18:31:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932259AbbLXSbh (ORCPT ); Thu, 24 Dec 2015 13:31:37 -0500 Received: from cmrelayp1.emulex.com ([138.239.112.140]:50940 "EHLO CMRELAYP1.ad.emulex.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1755479AbbLXSbh (ORCPT ); Thu, 24 Dec 2015 13:31:37 -0500 X-Greylist: delayed 1021 seconds by postgrey-1.27 at vger.kernel.org; Thu, 24 Dec 2015 13:31:36 EST Received: from neo01-el71.iig.avagotech.net ([10.192.205.132]) by CMRELAYP1.ad.emulex.com with Microsoft SMTPSVC(7.5.7601.17514); Thu, 24 Dec 2015 10:14:45 -0800 From: Devesh Sharma To: linux-rdma@vger.kernel.org Cc: dledford@redhat.com, Devesh Sharma , Padmanabh Ratnakar Subject: [PATCH 2/4] RDMA/ocrdma: Dispatch only port event when port state changes Date: Thu, 24 Dec 2015 13:14:06 -0500 Message-Id: <1450980848-18945-3-git-send-email-devesh.sharma@avagotech.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1450980848-18945-1-git-send-email-devesh.sharma@avagotech.com> References: <1450980848-18945-1-git-send-email-devesh.sharma@avagotech.com> X-OriginalArrivalTime: 24 Dec 2015 18:14:45.0471 (UTC) FILETIME=[F7C9B6F0:01D13E76] 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, 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 Dispatch only port event to IB stack when port state changes. Don't explicitly modify qps to error. Let application listen to port events on async event queue or let QP fail with retry-exceeded completion error. Signed-off-by: Padmanabh Ratnakar Signed-off-by: Devesh Sharma --- drivers/infiniband/hw/ocrdma/ocrdma_main.c | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_main.c b/drivers/infiniband/hw/ocrdma/ocrdma_main.c index 62b7009..ebe40b4 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_main.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_main.c @@ -386,30 +386,7 @@ static int ocrdma_open(struct ocrdma_dev *dev) static int ocrdma_close(struct ocrdma_dev *dev) { - int i; - struct ocrdma_qp *qp, **cur_qp; struct ib_event err_event; - struct ib_qp_attr attrs; - int attr_mask = IB_QP_STATE; - - attrs.qp_state = IB_QPS_ERR; - mutex_lock(&dev->dev_lock); - if (dev->qp_tbl) { - cur_qp = dev->qp_tbl; - for (i = 0; i < OCRDMA_MAX_QP; i++) { - qp = cur_qp[i]; - if (qp && qp->ibqp.qp_type != IB_QPT_GSI) { - /* change the QP state to ERROR */ - _ocrdma_modify_qp(&qp->ibqp, &attrs, attr_mask); - - err_event.event = IB_EVENT_QP_FATAL; - err_event.element.qp = &qp->ibqp; - err_event.device = &dev->ibdev; - ib_dispatch_event(&err_event); - } - } - } - mutex_unlock(&dev->dev_lock); err_event.event = IB_EVENT_PORT_ERR; err_event.element.port_num = 1;