From patchwork Mon Apr 20 08:43: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: 6240921 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 2C2BC9F1BE for ; Mon, 20 Apr 2015 08:43:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3B8EA20361 for ; Mon, 20 Apr 2015 08:43:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3B3A52035D for ; Mon, 20 Apr 2015 08:43:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755239AbbDTInb (ORCPT ); Mon, 20 Apr 2015 04:43:31 -0400 Received: from mail-wi0-f170.google.com ([209.85.212.170]:33459 "EHLO mail-wi0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754714AbbDTIn3 (ORCPT ); Mon, 20 Apr 2015 04:43:29 -0400 Received: by wiax7 with SMTP id x7so77856513wia.0 for ; Mon, 20 Apr 2015 01:43:28 -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=A7GcPvrAOTVw4qzNzwY9HqF75buMih6j1NbC7vmNgKs=; b=SibjgPwMmf1rt5HNhTrzh8gSpi+IBeBqfo2P5tz72BdhD2RC/tltr5WTkCXrrSHnfe 9X30nEByIll7E4cg5xkzOq90N05SuIPnmrE/oqSUmXCnCkRAcqRV1nO+4OhsI7Y/D1bd 7m34ii12uoEOvyoTI/OCe0bqEmTMQz1nJt5ken57fYeWxDco23op6AhsR+LKV0VJ3Wbx 3kkTL6soVYiTtmjoaKiCBix9mClYIRI49YGZd7sfUgdwe8dToDFgPFPNkSLzCn6hUYmg 4fVHZJc1/QW3E+ei8RaarjWtLyT7WVAJOxboW781+ie0j1dEoyEYXm0Pn2H8VvXUzvTP XJ+w== X-Gm-Message-State: ALoCoQmMStYsVicdTgi7+9LqhmXjkSxLN2or5GT0PazIA/CWfhVOLAt8/DBiZ2n0XTkJe+1pu8nD X-Received: by 10.194.109.9 with SMTP id ho9mr28336134wjb.29.1429519408526; Mon, 20 Apr 2015 01:43:28 -0700 (PDT) Received: from [192.168.71.52] ([62.217.45.26]) by mx.google.com with ESMTPSA id s4sm14236980wix.14.2015.04.20.01.43.26 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Apr 2015 01:43:27 -0700 (PDT) Message-ID: <5534BC2E.40307@profitbricks.com> Date: Mon, 20 Apr 2015 10:43:26 +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 , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, hal@dev.mellanox.co.il 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 , Doug Ledford Subject: [PATCH v5 26/27] IB/Verbs: Clean up rdma_ib_or_iboe() References: <5534B8C9.506@profitbricks.com> In-Reply-To: <5534B8C9.506@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 We have finished introducing the cap_XX(), and raw helper rdma_ib_or_iboe() is no longer necessary, thus clean it up. 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 --- include/rdma/ib_verbs.h | 19 +++++++++---------- net/sunrpc/xprtrdma/svc_rdma_transport.c | 6 ++++-- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 45050cb..0c0a4f0 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h @@ -1766,13 +1766,6 @@ static inline int rdma_tech_iwarp(struct ib_device *device, u8 port_num) == RDMA_TRANSPORT_IWARP; } -static inline int rdma_ib_or_iboe(struct ib_device *device, u8 port_num) -{ - enum rdma_transport_type tp = device->query_transport(device, port_num); - - return (tp == RDMA_TRANSPORT_IB || tp == RDMA_TRANSPORT_IBOE); -} - /** * cap_ib_mad - Check if the port of device has the capability Infiniband * Management Datagrams. @@ -1785,7 +1778,9 @@ static inline int rdma_ib_or_iboe(struct ib_device *device, u8 port_num) */ static inline int cap_ib_mad(struct ib_device *device, u8 port_num) { - return rdma_ib_or_iboe(device, port_num); + enum rdma_transport_type tp = device->query_transport(device, port_num); + + return (tp == RDMA_TRANSPORT_IB || tp == RDMA_TRANSPORT_IBOE); } /** @@ -1815,7 +1810,9 @@ static inline int cap_ib_smi(struct ib_device *device, u8 port_num) */ static inline int cap_ib_cm(struct ib_device *device, u8 port_num) { - return rdma_ib_or_iboe(device, port_num); + enum rdma_transport_type tp = device->query_transport(device, port_num); + + return (tp == RDMA_TRANSPORT_IB || tp == RDMA_TRANSPORT_IBOE); } /** @@ -1890,7 +1887,9 @@ static inline int cap_ipoib(struct ib_device *device, u8 port_num) */ static inline int cap_af_ib(struct ib_device *device, u8 port_num) { - return rdma_ib_or_iboe(device, port_num); + enum rdma_transport_type tp = device->query_transport(device, port_num); + + return (tp == RDMA_TRANSPORT_IB || tp == RDMA_TRANSPORT_IBOE); } /** diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c index a09b7a1..8af6f92 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_transport.c +++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c @@ -987,8 +987,10 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt) */ if (!rdma_tech_iwarp(newxprt->sc_cm_id->device, newxprt->sc_cm_id->port_num) && - !rdma_ib_or_iboe(newxprt->sc_cm_id->device, - newxprt->sc_cm_id->port_num)) + !rdma_tech_ib(newxprt->sc_cm_id->device, + newxprt->sc_cm_id->port_num) && + !rdma_tech_iboe(newxprt->sc_cm_id->device, + newxprt->sc_cm_id->port_num)) goto errout; if (!(newxprt->sc_dev_caps & SVCRDMA_DEVCAP_FAST_REG) ||