From patchwork Tue May 5 12:50:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Wang X-Patchwork-Id: 6337791 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6BA9ABEEE1 for ; Tue, 5 May 2015 12:55:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8865620149 for ; Tue, 5 May 2015 12:55:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A31C920266 for ; Tue, 5 May 2015 12:55:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1423022AbbEEMzF (ORCPT ); Tue, 5 May 2015 08:55:05 -0400 Received: from mail-wg0-f51.google.com ([74.125.82.51]:35410 "EHLO mail-wg0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758708AbbEEMvB (ORCPT ); Tue, 5 May 2015 08:51:01 -0400 Received: by wgyo15 with SMTP id o15so181780528wgy.2 for ; Tue, 05 May 2015 05:51:00 -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=db85pZYmFdotAxcDFrGLCrBN1gVK7QKl+Ef9sNdczcA=; b=CorAflXH8/4mG/yEUOvtzsqe+CfFP/fEmYyvsAQr8vw0Ln3fmNlkPLiJYwheLGWGWo /6jWWIEIQMvIPP1sAFzhF9uai+0VH8XBymn8x3VslkZJQkQ4KCgpCLGmGFtVyNnrxU/S DxbyWUi4UOUP0wFkPwky46SQme1MbkU8viUg2BF5jNbWByMZfC7i1bUynvop6XB2e8Q9 es1IKR0dNLPIdXNila0GX4OCPAichn6dhprPb3fMBXtggWasT56R1DekMth3Qy46T9sw hVsVmzPIylLDvkKzfdNpefN/xJ6a+kzCdpJniaTHn9okvL3bymjCEB1L6oD3jZxF2xC+ b5dA== X-Gm-Message-State: ALoCoQmVKGowJXPnZZ9ToGyS+l2GAwvt+NeZVB+Jxvg+5zjXnNv66UlH7+ys8Nb/wJYHPa13wqh/ X-Received: by 10.180.75.197 with SMTP id e5mr3788136wiw.94.1430830260038; Tue, 05 May 2015 05:51:00 -0700 (PDT) Received: from ubuntu.pb.local ([62.217.45.26]) by mx.google.com with ESMTPSA id gs7sm16033234wib.10.2015.05.05.05.50.58 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 05 May 2015 05:50:59 -0700 (PDT) From: Michael Wang To: Roland Dreier , Sean Hefty , Hal Rosenstock , Doug Ledford , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Michael Wang , 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 , Devesh Sharma , Liran Liss , Dave Goodell Subject: [PATCH v8 09/23] IB/Verbs: Reform IB-core verbs Date: Tue, 5 May 2015 14:50:26 +0200 Message-Id: <1430830240-32389-10-git-send-email-yun.wang@profitbricks.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1430830240-32389-1-git-send-email-yun.wang@profitbricks.com> References: <1430830240-32389-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=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY 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 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)