Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965523AbbDVAI4 (ORCPT ); Tue, 21 Apr 2015 20:08:56 -0400 Received: from mga03.intel.com ([134.134.136.65]:11515 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964887AbbDVAIv (ORCPT ); Tue, 21 Apr 2015 20:08:51 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,619,1422950400"; d="scan'208";a="713248220" Date: Tue, 21 Apr 2015 20:08:45 -0400 From: "ira.weiny" To: Michael Wang Cc: Roland Dreier , Sean Hefty , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, hal@dev.mellanox.co.il, Tom Tucker , Steve Wise , Hoang-Nam Nguyen , Christoph Raisch , Mike Marciniszyn , Eli Cohen , Faisal Latif , Jack Morgenstein , Or Gerlitz , Haggai Eran , Tom Talpey , Jason Gunthorpe , Doug Ledford Subject: Re: [PATCH v5 15/27] IB/Verbs: Reform rest part in IB-core cma Message-ID: <20150422000844.GO15893@phlsvsds.ph.intel.com> References: <5534B8C9.506@profitbricks.com> <5534BB19.9000003@profitbricks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5534BB19.9000003@profitbricks.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: 2676 Lines: 73 On Mon, Apr 20, 2015 at 10:38:49AM +0200, Michael Wang wrote: > > Use raw management helpers to reform rest part in IB-core cma. > > Cc: Hal Rosenstock > Cc: Steve Wise > Cc: Tom Talpey > Cc: Jason Gunthorpe > Cc: Doug Ledford > Cc: Ira Weiny > Cc: Sean Hefty > Signed-off-by: Michael Wang Reviewed-by: Ira Weiny > --- > drivers/infiniband/core/cma.c | 20 +++++++++----------- > 1 file changed, 9 insertions(+), 11 deletions(-) > > diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c > index 44e7bb9..ec64b97 100644 > --- a/drivers/infiniband/core/cma.c > +++ b/drivers/infiniband/core/cma.c > @@ -468,10 +468,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_or_iboe(cur_dev->device, p)) > + continue; > + > if (ib_find_cached_pkey(cur_dev->device, p, pkey, &index)) > continue; > > @@ -666,10 +666,9 @@ static int cma_modify_qp_rtr(struct rdma_id_private *id_priv, > if (ret) > goto out; > > - if (rdma_node_get_transport(id_priv->cma_dev->device->node_type) > - == RDMA_TRANSPORT_IB && > - rdma_port_get_link_layer(id_priv->id.device, id_priv->id.port_num) > - == IB_LINK_LAYER_ETHERNET) { > + BUG_ON(id_priv->cma_dev->device != id_priv->id.device); > + > + if (rdma_tech_iboe(id_priv->id.device, id_priv->id.port_num)) { > ret = rdma_addr_find_smac_by_sgid(&sgid, qp_attr.smac, NULL); > > if (ret) > @@ -733,11 +732,10 @@ 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) > - pkey = ib_addr_get_pkey(dev_addr); > - else > + if (rdma_tech_iboe(id_priv->id.device, id_priv->id.port_num)) > pkey = 0xffff; > + else > + pkey = ib_addr_get_pkey(dev_addr); > > ret = ib_find_cached_pkey(id_priv->id.device, id_priv->id.port_num, > pkey, &qp_attr->pkey_index); > -- > 2.1.0 -- 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/