Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757742AbbDXQmd (ORCPT ); Fri, 24 Apr 2015 12:42:33 -0400 Received: from quartz.orcorp.ca ([184.70.90.242]:36424 "EHLO quartz.orcorp.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932218AbbDXQmc (ORCPT ); Fri, 24 Apr 2015 12:42:32 -0400 Date: Fri, 24 Apr 2015 10:42:26 -0600 From: Jason Gunthorpe To: Liran Liss Cc: "linux-rdma@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "ira.weiny" , Michael Wang , Roland Dreier , Sean Hefty , Hal Rosenstock , "hal@dev.mellanox.co.il" , Tom Tucker , Steve Wise , Hoang-Nam Nguyen , "raisch@de.ibm.com" , Mike Marciniszyn , Eli Cohen , Faisal Latif , Jack Morgenstein , Or Gerlitz , Haggai Eran , Tom Talpey , Doug Ledford Subject: Re: [PATCH v5 00/27] IB/Verbs: IB Management Helpers Message-ID: <20150424164226.GB9305@obsidianresearch.com> References: <5534B8C9.506@profitbricks.com> <20150422024123.GA18675@phlsvsds.ph.intel.com> <20150422164034.GB19500@obsidianresearch.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: 1671 Lines: 47 On Fri, Apr 24, 2015 at 03:00:15PM +0000, Liran Liss wrote: > Currently, the only code in the kernel that has an SMI interface is IB. > When OPA is introduced, add the proper helper. We already have tests checking for SMI is supported so QP0 can be created, this is to support ROCEE > All I am saying is that there will always be code paths that are > technology- and standards-specific. For example, the low-level MAD > processing code *must* do stuff like: > if (rdma_is_transport_ib()) > /* IB-spec compliant stuff */ > else if (rdma_is_transport_opa()) > /* OPA stuff */ Why should we open code that? It is back to what I said - that doesn't help the reader. Which of the few differences between OPA and IB MADs is that code trying to deal with? Heck, what are the differences? Do you know? Do I know? If you don't know what the differences are, you can't realistically work on the MAD layer anymore, because you might break OPA. Whereas, If I see: if (cap_2k_mad()) /* Special handling for OPA 2k mad support */ if (cap_opa_mad_space() && mad->baseVersion == ... ) /* Decode OPA mads */ if (cap_ib_mad_space() && mad->baseVersion == ... ) /* Decode IB mads */ The I *know* what to look for when writing new code. That is the problem we are trying to address here. iWarp has already created it, we addressed it using 'rdma_is_transport_iwarp' and I don't think those results were very satisfying. 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/