From owner-svn-src-projects@FreeBSD.ORG Fri Feb 25 03:19:25 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31333106566B; Fri, 25 Feb 2011 03:19:25 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 056408FC19; Fri, 25 Feb 2011 03:19:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1P3JOtM082955; Fri, 25 Feb 2011 03:19:24 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1P3JOgR082953; Fri, 25 Feb 2011 03:19:24 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201102250319.p1P3JOgR082953@svn.freebsd.org> From: Jeff Roberson Date: Fri, 25 Feb 2011 03:19:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219023 - projects/ofed/head/sys/ofed/drivers/infiniband/ulp/ipoib X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Feb 2011 03:19:25 -0000 Author: jeff Date: Fri Feb 25 03:19:24 2011 New Revision: 219023 URL: http://svn.freebsd.org/changeset/base/219023 Log: - We always poll for send completions now, assume the lock is held. - Free the path late in teardown since we can not free it when a tx errors. Modified: projects/ofed/head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c Modified: projects/ofed/head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c ============================================================================== --- projects/ofed/head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c Fri Feb 25 03:06:31 2011 (r219022) +++ projects/ofed/head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c Fri Feb 25 03:19:24 2011 (r219023) @@ -685,7 +685,6 @@ void ipoib_cm_handle_tx_wc(struct ipoib_ unsigned int wr_id = wc->wr_id & ~IPOIB_OP_CM; struct ifnet *dev = priv->dev; struct ipoib_tx_buf *tx_req; - unsigned long flags; ipoib_dbg_data(priv, "cm send completion: id %d, status: %d\n", wr_id, wc->status); @@ -710,7 +709,7 @@ void ipoib_cm_handle_tx_wc(struct ipoib_ if (unlikely(--priv->tx_outstanding == ipoib_sendq_size >> 1) && (dev->if_drv_flags & IFF_DRV_OACTIVE) != 0 && test_bit(IPOIB_FLAG_ADMIN_UP, &priv->flags)) - dev->if_drv_flags |= IFF_DRV_OACTIVE; + dev->if_drv_flags &= ~IFF_DRV_OACTIVE; if (wc->status != IB_WC_SUCCESS && wc->status != IB_WC_WR_FLUSH_ERR) { @@ -720,12 +719,10 @@ void ipoib_cm_handle_tx_wc(struct ipoib_ "(status=%d, wrid=%d vend_err %x)\n", wc->status, wr_id, wc->vendor_err); - spin_lock_irqsave(&priv->lock, flags); path = tx->path; if (path) { path->cm = NULL; - tx->path = NULL; rb_erase(&path->rb_node, &priv->path_tree); list_del(&path->list); } @@ -736,10 +733,6 @@ void ipoib_cm_handle_tx_wc(struct ipoib_ } clear_bit(IPOIB_FLAG_OPER_UP, &tx->flags); - - spin_unlock_irqrestore(&priv->lock, flags); - if (path) - ipoib_path_free(priv, path); } } @@ -1080,6 +1073,9 @@ static void ipoib_cm_tx_destroy(struct i ipoib_dbg(priv, "Destroy active connection 0x%x head 0x%x tail 0x%x\n", p->qp ? p->qp->qp_num : 0, p->tx_head, p->tx_tail); + if (p->path) + ipoib_path_free(priv, p->path); + if (p->id) ib_destroy_cm_id(p->id); @@ -1107,7 +1103,7 @@ timeout: if (unlikely(--priv->tx_outstanding == ipoib_sendq_size >> 1) && (dev->if_drv_flags & IFF_DRV_OACTIVE) != 0 && test_bit(IPOIB_FLAG_ADMIN_UP, &priv->flags)) - dev->if_drv_flags |= IFF_DRV_OACTIVE; + dev->if_drv_flags &= ~IFF_DRV_OACTIVE; } if (p->qp)