From patchwork Mon Apr 13 12:29:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Wang X-Patchwork-Id: 6207891 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AE1F29F1AC for ; Mon, 13 Apr 2015 12:30:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D65EB202E6 for ; Mon, 13 Apr 2015 12:30:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F2C032026F for ; Mon, 13 Apr 2015 12:30:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753734AbbDMM3y (ORCPT ); Mon, 13 Apr 2015 08:29:54 -0400 Received: from mail-wg0-f47.google.com ([74.125.82.47]:33412 "EHLO mail-wg0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932313AbbDMM3v (ORCPT ); Mon, 13 Apr 2015 08:29:51 -0400 Received: by wgin8 with SMTP id n8so78821273wgi.0 for ; Mon, 13 Apr 2015 05:29:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=ocyBFDsJ1uJuUaA+olQ4uXP3x/sDbqMTqSpJ7vo6hFA=; b=N2bVl0JPplE/kR5x1zd+dSC20yjI+NY31Hk7JVCi8bUqv2YnhsbQBgRDSdP4wLjXbS rsCp8zaEfK1df8vPj39pAMNbsrexkg9wD4eDgqkSX/Je60cAykCFHwUZF3YmxRSPotlp Bc7wfn/UODhIRP8E/KM4ahk6lVFbal3fOOqvfN0HTh9GOJXQxLZ9c64KaDRnNCCfCKtw bJgjMVMYCKxNp0U9EE9LhUjD2htdBa29Z+FjWY34b88CclWx7wS+bKhyJcghvdA7bRsX 3TYwDxg8ix5RlLB6Wl1jNVGBRmWgIHF30T4CD70NYjvAgIt+GIpZu4kS15wI2l96Xv15 3OMg== X-Gm-Message-State: ALoCoQkg4KZb4wdZSc7eoyyR4jqvbmEHgpyFMth0GiJKSGECuRE/0siRes5/39eaaf3LHYXRuHGT X-Received: by 10.194.142.232 with SMTP id rz8mr9743645wjb.78.1428928190136; Mon, 13 Apr 2015 05:29:50 -0700 (PDT) Received: from [192.168.71.52] ([62.217.45.26]) by mx.google.com with ESMTPSA id c3sm11324142wiz.2.2015.04.13.05.29.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Apr 2015 05:29:49 -0700 (PDT) Message-ID: <552BB6BB.70701@profitbricks.com> Date: Mon, 13 Apr 2015 14:29:47 +0200 From: Michael Wang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Roland Dreier , Sean Hefty , Hal Rosenstock , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org CC: Tom Tucker , Steve Wise , Hoang-Nam Nguyen , Christoph Raisch , Mike Marciniszyn , Eli Cohen , Faisal Latif , Jack Morgenstein , Or Gerlitz , Haggai Eran , Ira Weiny , Tom Talpey , Jason Gunthorpe , Doug Ledford , Michael Wang Subject: [PATCH v3 15/28] IB/Verbs: Reform rest part in IB-core cma References: <552BB470.4090407@profitbricks.com> In-Reply-To: <552BB470.4090407@profitbricks.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY, URIBL_BLACK autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use raw management helpers to reform rest part in IB-core cma. Cc: Steve Wise Cc: Tom Talpey Cc: Jason Gunthorpe Cc: Doug Ledford Cc: Ira Weiny Cc: Sean Hefty Signed-off-by: Michael Wang --- drivers/infiniband/core/cma.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c index c528d17..33d080f 100644 --- a/drivers/infiniband/core/cma.c +++ b/drivers/infiniband/core/cma.c @@ -469,10 +469,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; @@ -667,10 +667,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) @@ -734,8 +733,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_tech_ib(id_priv->id.device, id_priv->id.port_num)) pkey = ib_addr_get_pkey(dev_addr); else pkey = 0xffff;