Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932266AbbDHRC0 (ORCPT ); Wed, 8 Apr 2015 13:02:26 -0400 Received: from mga14.intel.com ([192.55.52.115]:21798 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754231AbbDHRCW (ORCPT ); Wed, 8 Apr 2015 13:02:22 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,545,1422950400"; d="scan'208";a="710732471" From: "Hefty, Sean" To: Michael Wang , Roland Dreier , "linux-rdma@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-nfs@vger.kernel.org" , "netdev@vger.kernel.org" CC: Hal Rosenstock , Tom Tucker , Steve Wise , Hoang-Nam Nguyen , Christoph Raisch , infinipath , Eli Cohen , "Latif, Faisal" , Upinder Malhi , "Trond Myklebust" , "J. Bruce Fields" , "David S. Miller" , "Weiny, Ira" , PJ Waskiewicz , "Nikolova, Tatyana E" , Or Gerlitz , Jack Morgenstein , "Haggai Eran" , Ilya Nelkenbaum , "Yann Droneaud" , Bart Van Assche , Shachar Raindel , Sagi Grimberg , Devesh Sharma , Matan Barak , Moni Shoua , Jiri Kosina , Selvin Xavier , Mitesh Ahuja , "Li RongQing" , Rasmus Villemoes , "Estrin, Alex" , "Doug Ledford" , Eric Dumazet , "Erez Shitrit" , Tom Gundersen , Chuck Lever Subject: RE: [PATCH v2 13/17] IB/Verbs: Reform cma/ucma with management helpers Thread-Topic: [PATCH v2 13/17] IB/Verbs: Reform cma/ucma with management helpers Thread-Index: AQHQcS+UX0n+BPY0KEaYulhiRXLJhp1CALlwgAFRYYCAAAR30A== Date: Wed, 8 Apr 2015 17:02:11 +0000 Message-ID: <1828884A29C6694DAF28B7E6B8A82373A8FBF037@ORSMSX109.amr.corp.intel.com> References: <5523CCD5.6030401@profitbricks.com> <5523CF74.8020004@profitbricks.com> <1828884A29C6694DAF28B7E6B8A82373A8FBE42B@ORSMSX109.amr.corp.intel.com> <5524F6BD.30105@profitbricks.com> In-Reply-To: <5524F6BD.30105@profitbricks.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.22.254.139] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id t38H2Zar009642 Content-Length: 2595 Lines: 64 > On 04/07/2015 11:36 PM, Hefty, Sean wrote: > >> diff --git a/drivers/infiniband/core/cma.c > b/drivers/infiniband/core/cma.c > >> index d8a8ea7..c23f483 100644 > >> --- a/drivers/infiniband/core/cma.c > >> +++ b/drivers/infiniband/core/cma.c > >> @@ -435,10 +435,10 @@ static int cma_resolve_ib_dev(struct > rdma_id_private > >> *id_priv) > >> pkey = ntohs(addr->sib_pkey); > >> > >> list_for_each_entry(cur_dev, &dev_list, list) { > >> - if (rdma_node_get_transport(cur_dev->device->node_type) != > >> RDMA_TRANSPORT_IB) > >> - continue; > >> - > >> for (p = 1; p <= cur_dev->device->phys_port_cnt; ++p) { > >> + if (!rdma_ib_mgmt(cur_dev->device, p)) > >> + continue; > > > > This check wants to be something like is_af_ib_supported(). Checking > for IB transport may actually be better than checking for IB management. > I don't know if IBoE/RoCE devices support AF_IB. > > The wrapper make sense, but do we have the guarantee that IBoE port won't > be used for AF_IB address? I just can't locate the place we filtered it > out... I can't think of a reason why IBoE wouldn't work with AF_IB, but I'm not sure if anyone has tested it. The original check would have let IBoE through. When I suggested checking for IB transport, I meant the actual transport protocol, which would have included both IB and IBoE. > >> @@ -700,8 +700,7 @@ static int cma_ib_init_qp_attr(struct > rdma_id_private > >> *id_priv, > >> int ret; > >> u16 pkey; > >> > >> - if (rdma_port_get_link_layer(id_priv->id.device, id_priv- > >>> id.port_num) == > >> - IB_LINK_LAYER_INFINIBAND) > >> + if (rdma_transport_ib(id_priv->id.device, id_priv->id.port_num)) > >> pkey = ib_addr_get_pkey(dev_addr); > >> else > >> pkey = 0xffff; > > > > Check here should be against the link layer, not transport. > > I guess the name confusing us again... what if use rdma_tech_ib() here? > it's the only tech using IB link layers, others are all ETH. Yes, that would work. > >> id_priv->id.route.addr.dev_addr.dev_type = > >> - (rdma_port_get_link_layer(cma_dev->device, p) == > >> IB_LINK_LAYER_INFINIBAND) ? > >> + (rdma_transport_ib(cma_dev->device, p)) ? > >> ARPHRD_INFINIBAND : ARPHRD_ETHER; > > > > This wants the link layer, or maybe use cap_ipoib. > > Is this related with ipoib only? ARPHDR_INFINIBAND is related to ipoib. In your next update, maybe go with tech_ib. I don't know the status of ipoib over iboe. ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?