From patchwork Mon Aug 23 19:53:16 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Mason X-Patchwork-Id: 125471 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o7NJsnLq003436 for ; Mon, 23 Aug 2010 19:55:35 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754292Ab0HWTyo (ORCPT ); Mon, 23 Aug 2010 15:54:44 -0400 Received: from rcsinet10.oracle.com ([148.87.113.121]:21264 "EHLO rcsinet10.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754228Ab0HWTyo (ORCPT ); Mon, 23 Aug 2010 15:54:44 -0400 Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o7NJsZ3r027093 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 23 Aug 2010 19:54:39 GMT Received: from acsmt355.oracle.com (acsmt355.oracle.com [141.146.40.155]) by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o7NJsT3q011131; Mon, 23 Aug 2010 19:54:35 GMT Received: from abhmt013.oracle.com by acsmt354.oracle.com with ESMTP id 523208421282593200; Mon, 23 Aug 2010 12:53:20 -0700 Received: from localhost (/66.66.148.185) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 23 Aug 2010 12:53:19 -0700 Date: Mon, 23 Aug 2010 15:53:16 -0400 From: Chris Mason To: linux-rdma@vger.kernel.org Cc: Roland Dreier Subject: [PATCH RFC] ipoib: good references make good neighbors Message-ID: <20100823195316.GL26773@think> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 23 Aug 2010 19:55:42 +0000 (UTC) --- ofa_kernel-1.5.1/drivers/infiniband/ulp/ipoib/ipoib_main.c 2010-08-23 05:16:57.000000000 -0700 +++ ofa_kernel-1.5.1-refs/drivers/infiniband/ulp/ipoib/ipoib_main.c 2010-08-22 13:35:43.000000000 -0700 @@ -919,6 +919,7 @@ struct ipoib_neigh *ipoib_neigh_alloc(st if (!neigh) return NULL; + neigh_hold(neighbour); neigh->neighbour = neighbour; neigh->dev = dev; memset(&neigh->dgid.raw, 0, sizeof (union ib_gid)); @@ -932,6 +933,7 @@ struct ipoib_neigh *ipoib_neigh_alloc(st void ipoib_neigh_free(struct net_device *dev, struct ipoib_neigh *neigh) { struct sk_buff *skb; + struct neighbour *neighbour = neigh->neighbour; *to_ipoib_neigh(neigh->neighbour) = NULL; while ((skb = __skb_dequeue(&neigh->queue))) { ++dev->stats.tx_dropped; @@ -940,6 +942,7 @@ void ipoib_neigh_free(struct net_device if (ipoib_cm_get(neigh)) ipoib_cm_destroy_tx(ipoib_cm_get(neigh)); kfree(neigh); + neigh_release(neighbour); } static int ipoib_neigh_setup_dev(struct net_device *dev, struct neigh_parms *parms)