Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754581AbbDMTw1 (ORCPT ); Mon, 13 Apr 2015 15:52:27 -0400 Received: from mga02.intel.com ([134.134.136.20]:53048 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751585AbbDMTw0 (ORCPT ); Mon, 13 Apr 2015 15:52:26 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,571,1422950400"; d="scan'208";a="555398156" Date: Mon, 13 Apr 2015 15:52:17 -0400 From: "ira.weiny" To: Jason Gunthorpe Cc: "Hefty, Sean" , Michael Wang , Roland Dreier , Hal Rosenstock , "linux-rdma@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Tom Tucker , Steve Wise , Hoang-Nam Nguyen , Christoph Raisch , infinipath , Eli Cohen , "Latif, Faisal" , Jack Morgenstein , Or Gerlitz , Haggai Eran , Tom Talpey , Doug Ledford Subject: Re: [PATCH v3 04/28] IB/Verbs: Reform IB-core cm Message-ID: <20150413195216.GB21467@phlsvsds.ph.intel.com> References: <552BB470.4090407@profitbricks.com> <552BB552.1030905@profitbricks.com> <20150413181248.GA2464@phlsvsds.ph.intel.com> <1828884A29C6694DAF28B7E6B8A82373A8FC0A3A@ORSMSX109.amr.corp.intel.com> <20150413192930.GA18587@obsidianresearch.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150413192930.GA18587@obsidianresearch.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: 1540 Lines: 41 On Mon, Apr 13, 2015 at 01:29:30PM -0600, Jason Gunthorpe wrote: > On Mon, Apr 13, 2015 at 06:40:35PM +0000, Hefty, Sean wrote: > > > > - if (rdma_node_get_transport(ib_device->node_type) != > > > RDMA_TRANSPORT_IB) > > > > - return; > > > > + int count = 0; > > > > > > I'm ok with this as an intermediate patch but going forward if we are > > > going to > > > have calls like > > > > > > static inline int cap_ib_cm_dev(struct ib_device *device) > > > > I would rather keep everything to checking per port, not per device. > > Specifically, because we have code that does this: > > Argee. > > I asked Michael for it and stand by it, the property is per-port, not > per device. Having the per-device tests just muddles the logic, look > at the trouble Sean notices in #10 when we are now forced to think of > things clearly. What about having those be helpers within the corresponding C code? For example move cap_ib_cm_dev() into cm.c. Or just put the logic at the top of cm_add_one()? I think that having the ib_umad, ib_sa, and ib_cm modules skip devices which have no ports which support those functions makes the code clean. But I understand the desire to have checks from the devices be per port. Also for these function clean up patches we preserve the existing logic. Ira -- 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/