Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965397AbbDVAGk (ORCPT ); Tue, 21 Apr 2015 20:06:40 -0400 Received: from mga14.intel.com ([192.55.52.115]:3484 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965380AbbDVAGe (ORCPT ); Tue, 21 Apr 2015 20:06:34 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,619,1422950400"; d="scan'208";a="713247198" Date: Tue, 21 Apr 2015 20:06:27 -0400 From: "ira.weiny" To: Michael Wang Cc: Roland Dreier , Sean Hefty , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, hal@dev.mellanox.co.il, Tom Tucker , Steve Wise , Hoang-Nam Nguyen , Christoph Raisch , Mike Marciniszyn , Eli Cohen , Faisal Latif , Jack Morgenstein , Or Gerlitz , Haggai Eran , Tom Talpey , Jason Gunthorpe , Doug Ledford Subject: Re: [PATCH v5 07/27] IB/Verbs: Reform IB-ulp ipoib Message-ID: <20150422000626.GH15893@phlsvsds.ph.intel.com> References: <5534B8C9.506@profitbricks.com> <5534BA43.6060400@profitbricks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5534BA43.6060400@profitbricks.com> User-Agent: Mutt/1.4.2.2i Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2371 Lines: 74 On Mon, Apr 20, 2015 at 10:35:15AM +0200, Michael Wang wrote: > > Use raw management helpers to reform IB-ulp ipoib. > > Cc: Hal Rosenstock > Cc: Steve Wise > Cc: Tom Talpey > Cc: Jason Gunthorpe > Cc: Doug Ledford > Cc: Ira Weiny > Cc: Sean Hefty > Signed-off-by: Michael Wang Reviewed-by: Ira Weiny > --- > drivers/infiniband/ulp/ipoib/ipoib_main.c | 15 ++++++++------- > 1 file changed, 8 insertions(+), 7 deletions(-) > > diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c > index 58b5aa3..60b379d 100644 > --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c > +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c > @@ -1654,9 +1654,7 @@ static void ipoib_add_one(struct ib_device *device) > struct net_device *dev; > struct ipoib_dev_priv *priv; > int s, e, p; > - > - if (rdma_node_get_transport(device->node_type) != RDMA_TRANSPORT_IB) > - return; > + int count = 0; > > dev_list = kmalloc(sizeof *dev_list, GFP_KERNEL); > if (!dev_list) > @@ -1673,15 +1671,21 @@ static void ipoib_add_one(struct ib_device *device) > } > > for (p = s; p <= e; ++p) { > - if (rdma_port_get_link_layer(device, p) != IB_LINK_LAYER_INFINIBAND) > + if (!rdma_tech_ib(device, p)) > continue; > dev = ipoib_add_port("ib%d", device, p); > if (!IS_ERR(dev)) { > priv = netdev_priv(dev); > list_add_tail(&priv->list, dev_list); > + count++; > } > } > > + if (!count) { > + kfree(dev_list); > + return; > + } > + > ib_set_client_data(device, &ipoib_client, dev_list); > } > > @@ -1690,9 +1694,6 @@ static void ipoib_remove_one(struct ib_device *device) > struct ipoib_dev_priv *priv, *tmp; > struct list_head *dev_list; > > - if (rdma_node_get_transport(device->node_type) != RDMA_TRANSPORT_IB) > - return; > - > dev_list = ib_get_client_data(device, &ipoib_client); > if (!dev_list) > return; > -- > 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/