Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754635AbbDMUBw (ORCPT ); Mon, 13 Apr 2015 16:01:52 -0400 Received: from quartz.orcorp.ca ([184.70.90.242]:33220 "EHLO quartz.orcorp.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754412AbbDMUBu (ORCPT ); Mon, 13 Apr 2015 16:01:50 -0400 Date: Mon, 13 Apr 2015 14:01:38 -0600 From: Jason Gunthorpe To: "ira.weiny" Cc: Michael Wang , Roland Dreier , Sean Hefty , Hal Rosenstock , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Tom Tucker , Steve Wise , Hoang-Nam Nguyen , Christoph Raisch , Mike Marciniszyn , Eli Cohen , Faisal Latif , Jack Morgenstein , Or Gerlitz , Haggai Eran , Tom Talpey , Doug Ledford Subject: Re: [PATCH v3 07/28] IB/Verbs: Reform IB-ulp ipoib Message-ID: <20150413200138.GC19112@obsidianresearch.com> References: <552BB470.4090407@profitbricks.com> <552BB5AC.6050101@profitbricks.com> <20150413192701.GA19112@obsidianresearch.com> <20150413194602.GA21467@phlsvsds.ph.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150413194602.GA21467@phlsvsds.ph.intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Broken-Reverse-DNS: no host name found for IP address 10.0.0.183 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1559 Lines: 47 On Mon, Apr 13, 2015 at 03:46:03PM -0400, ira.weiny wrote: > > This doesn't quite look right, it should be 'goto error1' > > Looks like you replied to the wrong patch. ?? I don't see error1 in ipoib_add_one. > For the ib_cm module... Right, sorry. > Yes I think it should go to "error1". However, see below... > > This is the type of clean up error which would be avoided if a call to > cap_ib_cm_dev() were done at the top of the function. So what does cap_ib_cm_dev return in your example: > Dev > port 1 : cap_is_cm == true > port 2 : cap_is_cm == false > port 3 : cap_is_cm == true True? Then the code is still broken, having cap_ib_cm_dev doesn't help anything. If we make it possible to be per port then it has to be fixed. If you want to argue the above example is illegal and port 2 has to be on a different device, I'd be interested to see what that looks like. Thinking about it some more, cap_foo_dev only makes sense if all ports are either true or false. Mixed is a BUG. That seems reasonable, and solves the #10 problem, but we should enforce this invariant during device register. Typically the ports seem to be completely orthogonal (like SA), so in those cases the _dev and restriction makes no sense. CM seems to be different, so it should probably enforce its rules Jason -- 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/