From patchwork Mon Oct 12 22:56:51 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vu Pham X-Patchwork-Id: 53260 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9CN8mFt008004 for ; Mon, 12 Oct 2009 23:08:49 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757339AbZJLXG5 (ORCPT ); Mon, 12 Oct 2009 19:06:57 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757475AbZJLXG5 (ORCPT ); Mon, 12 Oct 2009 19:06:57 -0400 Received: from p02c12o145.mxlogic.net ([208.65.145.78]:42210 "EHLO p02c12o145.mxlogic.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932949AbZJLXG4 (ORCPT ); Mon, 12 Oct 2009 19:06:56 -0400 Received: from unknown [63.251.237.3] (EHLO p02c12o145.mxlogic.net) by p02c12o145.mxlogic.net(mxl_mta-6.4.0-0) with ESMTP id 596b3da4.bd2d9b90.74450.00-516.159717.p02c12o145.mxlogic.net (envelope-from ); Mon, 12 Oct 2009 17:07:01 -0600 (MDT) X-MXL-Hash: 4ad3b6952a84289b-b95fb369610fa3fdfe81f335b0e119dbc55c72e9 Received: from unknown [63.251.237.3] by p02c12o145.mxlogic.net(mxl_mta-6.4.0-0) with SMTP id e44b3da4.0.73309.00-007.157284.p02c12o145.mxlogic.net (envelope-from ); Mon, 12 Oct 2009 16:57:59 -0600 (MDT) X-MXL-Hash: 4ad3b477160d3e8f-9407209ae92af0d52eb5d0fd54b6a556b85b2ed3 Received: from [10.2.1.145] ([10.2.1.145]) by mtiexch01.mti.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 12 Oct 2009 15:59:30 -0700 Message-ID: <4AD3B433.7040803@mellanox.com> Date: Mon, 12 Oct 2009 15:56:51 -0700 From: Vu Pham User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Linux RDMA list Subject: [ofa-general][PATCH 1/4] SRP fail-over faster X-OriginalArrivalTime: 12 Oct 2009 22:59:30.0906 (UTC) FILETIME=[A84633A0:01CA4B8F] X-Spam: [F=0.2000000000; CM=0.500; S=0.200(2009092101)] X-MAIL-FROM: X-SOURCE-IP: [63.251.237.3] X-AnalysisOut: [v=1.0 c=1 a=BLRtcXQ9SQAA:10 a=xupnbh4h0YLOHZnncC45HQ==:17 ] X-AnalysisOut: [a=CbDCq_QkAAAA:8 a=PwJ2IG6fAAAA:8 a=AUd_NHdVAAAA:8 a=ds-WQ] X-AnalysisOut: [85DA9Wo1AZ1ez0A:9 a=OnVZENwcKRjR2JzuE3MA:7 a=U7ns6zSfTNsBp] X-AnalysisOut: [0RF0PYTE9frG84A:4 a=E3yz0KKPV6YA:10 a=JfD0Fch1gWkA:10] Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Index: ofed_kernel/drivers/infiniband/ulp/srp/ib_srp.c =================================================================== --- ofed_kernel.orig/drivers/infiniband/ulp/srp/ib_srp.c +++ ofed_kernel/drivers/infiniband/ulp/srp/ib_srp.c @@ -537,10 +537,10 @@ static void srp_reset_req(struct srp_tar static int srp_reconnect_target(struct srp_target_port *target) { - struct ib_qp_attr qp_attr; struct srp_request *req, *tmp; - struct ib_wc wc; int ret; + struct ib_cq *old_cq; + struct ib_qp *old_qp; spin_lock_irq(target->scsi_host->host_lock); if (target->state != SRP_TARGET_LIVE) { @@ -559,17 +559,17 @@ static int srp_reconnect_target(struct s if (ret) goto err; - qp_attr.qp_state = IB_QPS_RESET; - ret = ib_modify_qp(target->qp, &qp_attr, IB_QP_STATE); - if (ret) - goto err; - - ret = srp_init_qp(target, target->qp); - if (ret) + old_qp = target->qp; + old_cq = target->cq; + ret = srp_create_target_ib(target); + if (ret) { + target->qp = old_qp; + target->cq = old_cq; goto err; + } - while (ib_poll_cq(target->cq, 1, &wc) > 0) - ; /* nothing */ + ib_destroy_qp(old_qp); + ib_destroy_cq(old_cq); spin_lock_irq(target->scsi_host->host_lock); list_for_each_entry_safe(req, tmp, &target->req_queue, list)