From patchwork Fri Apr 24 12:23:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Wang X-Patchwork-Id: 6269811 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 9C1C4BF4A6 for ; Fri, 24 Apr 2015 12:28:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A9EB220268 for ; Fri, 24 Apr 2015 12:28:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A16AE20272 for ; Fri, 24 Apr 2015 12:28:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754329AbbDXM2K (ORCPT ); Fri, 24 Apr 2015 08:28:10 -0400 Received: from mail-wi0-f170.google.com ([209.85.212.170]:33261 "EHLO mail-wi0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754431AbbDXMYn (ORCPT ); Fri, 24 Apr 2015 08:24:43 -0400 Received: by wiax7 with SMTP id x7so33880565wia.0 for ; Fri, 24 Apr 2015 05:24:42 -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=hLexVqukBUBzEGq2RJc1eWes2zIkfyN3KkGQZ+R70/I=; b=dTBBpdxw8wB+mItkAH8dX6f+EFm5CzyBatSGSW4qDVc3RymCWBrl2T4zlofU4M1zWA jqdE/jucMEg/l6sg8yf1fWjBIGUh/2I6xiNp/qYw0Pshao2SsY9rR3pBt9pH4awNzGVX 1uR3ST0K5EbbtY297y2a2j6epbU7YUL6nAHjFXRXVCGn5gn5XiEyS+g79xNL13ZgVjNa A0RNmbL+Sblds+ODVukU/BSW39rCwEKCRz615XbffSHxixezV0TpIw0cxlEwVAKQVXKu hDXv2kZ28cvzFQUv0hBDlpl/X+GgbV9AqVs4fUedE4J1epWJL+6a4I/lc5d7/EksdbdW W7BA== X-Gm-Message-State: ALoCoQkCHrYg5VUUchYWtENy/+rED68gFx9Kso1e4pzuKwTJEdTpH96WACGnEUYkJ5BC0I3CoeQX X-Received: by 10.194.90.106 with SMTP id bv10mr15668761wjb.122.1429878281951; Fri, 24 Apr 2015 05:24:41 -0700 (PDT) Received: from ubuntu.pb.local ([62.217.45.26]) by mx.google.com with ESMTPSA id m4sm16704020wjb.25.2015.04.24.05.24.40 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Apr 2015 05:24:41 -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 Subject: [PATCH v6 25/26] IB/Verbs: Clean up rdma_ib_or_iboe() Date: Fri, 24 Apr 2015 14:23:49 +0200 Message-Id: <1429878230-11749-26-git-send-email-yun.wang@profitbricks.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1429878230-11749-1-git-send-email-yun.wang@profitbricks.com> References: <1429878230-11749-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=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 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 --- 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 f122df9..0def4e1 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); } /** @@ -1875,7 +1872,9 @@ static inline int cap_ib_mcast(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) ||