From patchwork Tue Apr 28 15:10:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Wang X-Patchwork-Id: 6290451 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 E08E69F1C2 for ; Tue, 28 Apr 2015 15:18:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 13CB320254 for ; Tue, 28 Apr 2015 15:18:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2BEA220251 for ; Tue, 28 Apr 2015 15:18:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030332AbbD1PKt (ORCPT ); Tue, 28 Apr 2015 11:10:49 -0400 Received: from mail-wi0-f182.google.com ([209.85.212.182]:36859 "EHLO mail-wi0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030299AbbD1PKq (ORCPT ); Tue, 28 Apr 2015 11:10:46 -0400 Received: by wizk4 with SMTP id k4so144620291wiz.1 for ; Tue, 28 Apr 2015 08:10:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=836WMHRgAPBxsZfEZTVyufO4o+tvHiL03KQEsAeTLJ8=; b=Hpdu+7B64ZPc+2xWJu2qwpTjcV0+zUL0LpuRxp34CcjfJzxfj888cNd+BGKPjdqeYh ZbWgxR7huLooPvGmWbDzaCAJ2zUn7Hq8Jksffd2q4ub1+XIWhDgPsTy24a84ob2Px9f+ nf0kQbeVV7AghqsKMODnAcYcvEuqMskvmXGtTZe8Z6VxK0H4reqh3G4iWG9SM5OXUuSU EYeJEtkUMt0jn+XVuQYHPbKSVHym9q81qNFjPhGpT5I1kKq9uybgw+euPaPq9QuaP1UP iMpGvKk8iL2UioWC3ULsGDu0FaXhIHotGG3l+RLEhEoKoAnes9w7YqBi5o8sbs0TxbAd i+aA== X-Gm-Message-State: ALoCoQlqB1NyQ/k8B46tYyeCPYvgpR5ca+rE7kfa4tYVke4Amt7/i/7i4ehmihIM0FDsVvVhYr90 X-Received: by 10.194.120.3 with SMTP id ky3mr33458724wjb.156.1430233845641; Tue, 28 Apr 2015 08:10:45 -0700 (PDT) Received: from ubuntu.pb.local ([62.217.45.26]) by mx.google.com with ESMTPSA id be3sm16820459wib.21.2015.04.28.08.10.43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 28 Apr 2015 08:10:44 -0700 (PDT) From: Michael Wang To: Roland Dreier , Sean Hefty , Hal Rosenstock , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Michael Wang , Steve Wise , Tom Talpey , Jason Gunthorpe , Doug Ledford , Ira Weiny , Tom Tucker , Hoang-Nam Nguyen , Christoph Raisch , Mike Marciniszyn , Eli Cohen , Faisal Latif , Jack Morgenstein , Or Gerlitz , Haggai Eran , Devesh Sharma , Liran Liss , Dave Goodell Subject: [PATCH v7 09/23] IB/Verbs: Reform IB-core verbs Date: Tue, 28 Apr 2015 17:10:09 +0200 Message-Id: <1430233823-7075-10-git-send-email-yun.wang@profitbricks.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1430233823-7075-1-git-send-email-yun.wang@profitbricks.com> References: <1430233823-7075-1-git-send-email-yun.wang@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=ham 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 IB-core verbs 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 --- drivers/infiniband/core/verbs.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c index f93eb8d..7dd2f51 100644 --- a/drivers/infiniband/core/verbs.c +++ b/drivers/infiniband/core/verbs.c @@ -198,11 +198,9 @@ int ib_init_ah_from_wc(struct ib_device *device, u8 port_num, struct ib_wc *wc, u32 flow_class; u16 gid_index; int ret; - int is_eth = (rdma_port_get_link_layer(device, port_num) == - IB_LINK_LAYER_ETHERNET); memset(ah_attr, 0, sizeof *ah_attr); - if (is_eth) { + if (rdma_protocol_iboe(device, port_num)) { if (!(wc->wc_flags & IB_WC_GRH)) return -EPROTOTYPE; @@ -871,7 +869,7 @@ int ib_resolve_eth_l2_attrs(struct ib_qp *qp, union ib_gid sgid; if ((*qp_attr_mask & IB_QP_AV) && - (rdma_port_get_link_layer(qp->device, qp_attr->ah_attr.port_num) == IB_LINK_LAYER_ETHERNET)) { + (rdma_protocol_iboe(qp->device, qp_attr->ah_attr.port_num))) { ret = ib_query_gid(qp->device, qp_attr->ah_attr.port_num, qp_attr->ah_attr.grh.sgid_index, &sgid); if (ret)