Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753481AbbDNIDv (ORCPT ); Tue, 14 Apr 2015 04:03:51 -0400 Received: from mail-wi0-f175.google.com ([209.85.212.175]:35022 "EHLO mail-wi0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753475AbbDNIDh (ORCPT ); Tue, 14 Apr 2015 04:03:37 -0400 Message-ID: <552CC9D5.2030408@profitbricks.com> Date: Tue, 14 Apr 2015 10:03:33 +0200 From: Michael Wang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: "Hefty, Sean" , Roland Dreier , Hal Rosenstock , "linux-rdma@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Tom Tucker , Steve Wise , Hoang-Nam Nguyen , Christoph Raisch , infinipath , Eli Cohen , "Latif, Faisal" , Jack Morgenstein , Or Gerlitz , Haggai Eran , "Weiny, Ira" , Tom Talpey , Jason Gunthorpe , Doug Ledford Subject: Re: [PATCH v3 05/28] IB/Verbs: Reform IB-core sa_query References: <552BB470.4090407@profitbricks.com> <552BB572.4040300@profitbricks.com> <1828884A29C6694DAF28B7E6B8A82373A8FC0A58@ORSMSX109.amr.corp.intel.com> In-Reply-To: <1828884A29C6694DAF28B7E6B8A82373A8FC0A58@ORSMSX109.amr.corp.intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1368 Lines: 37 On 04/13/2015 08:45 PM, Hefty, Sean wrote: >> @@ -1153,9 +1153,7 @@ static void ib_sa_add_one(struct ib_device *device) >> { >> struct ib_sa_device *sa_dev; >> int s, e, i; >> - >> - if (rdma_node_get_transport(device->node_type) != RDMA_TRANSPORT_IB) >> - return; >> + int count = 0; >> >> if (device->node_type == RDMA_NODE_IB_SWITCH) >> s = e = 0; >> @@ -1175,7 +1173,7 @@ static void ib_sa_add_one(struct ib_device *device) >> >> for (i = 0; i <= e - s; ++i) { >> spin_lock_init(&sa_dev->port[i].ah_lock); >> - if (rdma_port_get_link_layer(device, i + 1) != >> IB_LINK_LAYER_INFINIBAND) >> + if (!rdma_tech_ib(device, i + 1)) > > Note for someone who cares. This patch didn't introduce this problem, but I think the port number should be "i + s". Actually I'm planning to cleanup the places play with 's' and 'e' too, for example both cache.c and device.c implemented helper start_port() end_port() with exactly the same logical, and there are also many places like here which play with port number ugly, I'd like to refine these part later if no one else interested :-P Regards, Michael Wang > -- 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/