Return-Path: Received: from quartz.orcorp.ca ([184.70.90.242]:48851 "EHLO quartz.orcorp.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753111AbbCZVN4 (ORCPT ); Thu, 26 Mar 2015 17:13:56 -0400 Date: Thu, 26 Mar 2015 15:13:34 -0600 From: Jason Gunthorpe To: Michael Wang Cc: Doug Ledford , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org, netdev@vger.kernel.org, Roland Dreier , Sean Hefty , Hal Rosenstock , Ira Weiny , Trond Myklebust , "J. Bruce Fields" , "David S. Miller" , Moni Shoua , Or Gerlitz , Tatyana Nikolova , Steve Wise , Yan Burman , Jack Morgenstein , Bart Van Assche , Yann Droneaud , Colin Ian King , Jiri Kosina , Matan Barak , Majd Dibbiny , Dan Carpenter , Mel Gorman , Alex Estrin , Eric Dumazet , Erez Shitrit , Sagi Grimberg , Haggai Eran , Shachar Raindel , Mike Marciniszyn , Tom Tucker , Chuck Lever Subject: Re: [PATCH 0/2 RESEND] IB/Verbs: Use helpers to refine the checking on transport and link layer Message-ID: <20150326211334.GA3359@obsidianresearch.com> References: <5512CFB0.1050108@profitbricks.com> <1427378940.21101.100.camel@redhat.com> <55142DFD.2060100@profitbricks.com> <1427387258.21101.124.camel@redhat.com> <55143AAC.8040206@profitbricks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <55143AAC.8040206@profitbricks.com> Sender: linux-nfs-owner@vger.kernel.org List-ID: On Thu, Mar 26, 2015 at 05:58:20PM +0100, Michael Wang wrote: > The questions is just wondering how the transition method could be, but > if we have to do the changes for vendor, that sounds like a tough job... I would see changing how the information is represented in the struct as a follow on issue. The first patch should go through and replace all direct access to the link layer/transport/etc with an appropriately narrow is_XX() test like Doug was suggesting. That means looking at each code site and determining what it needs, making a is_XX for it and a kdoc describing exactly what is needed for the test to return true. The follow on patch can then rework the is_XX and drop the link layer/transport stuff.. Some ideas for is_XX: IB compatible SA QP0 SMP mechanism IB SMP format OPA SMP format QP1 GMP mechanism IB compatible CM GID addressing IP/IPv6 addressing Ethernet VLAN ... Jason