From patchwork Tue Apr 7 12:39:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Wang X-Patchwork-Id: 6170041 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 45013BF4A6 for ; Tue, 7 Apr 2015 12:40:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3A223202EC for ; Tue, 7 Apr 2015 12:40:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 014FE2014A for ; Tue, 7 Apr 2015 12:40:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753325AbbDGMkA (ORCPT ); Tue, 7 Apr 2015 08:40:00 -0400 Received: from mail-wg0-f51.google.com ([74.125.82.51]:34077 "EHLO mail-wg0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753401AbbDGMj6 (ORCPT ); Tue, 7 Apr 2015 08:39:58 -0400 Received: by wgbdm7 with SMTP id dm7so54620727wgb.1 for ; Tue, 07 Apr 2015 05:39:56 -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=ndp1ikzykz9QuvmEo5ESTHJVTeuyitB7IBCbzExHO3I=; b=XB86wxwOdesWyaG2u7xekwOunGqkfkEiQ3RAJzmwDTtuejXHr+ykeu3YsKosSc7SYC 1l1lPLFioQRAXj+6PzTQ3A7B7U8j27+MGdryeRwMZ1aiuqTxpdD0/qv84XkFXdtDC25L gufMURLbG5ETYcIpsk7uIsu288pl9McVMytSoICXXwPCN7HsbLiFKQyIBpm5ZCZCAunD V5D3fk2PmsRt3ip1MB6p9efqYIFXzk9KiazX6Kg96IOnDOyPw57n8I2/gFCPt/5yE+aY MA/FkMC7jtSeFJJbS2Cz6lTXzaBYqfSOta7warzMpemYApzhXINn4me37+pRA1FWXgoA MhQQ== X-Gm-Message-State: ALoCoQnom1OezMr5RXrDo0BHC+PhbfTYFDnaiuLk56PL9EKqddm+Uffn4XzlZxHhczfJqoBQt1rK X-Received: by 10.194.80.40 with SMTP id o8mr38584791wjx.34.1428410396749; Tue, 07 Apr 2015 05:39:56 -0700 (PDT) Received: from [192.168.71.52] ([62.217.45.26]) by mx.google.com with ESMTPSA id l3sm10851857wik.16.2015.04.07.05.39.54 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Apr 2015 05:39:55 -0700 (PDT) Message-ID: <5523D019.1060805@profitbricks.com> Date: Tue, 07 Apr 2015 14:39:53 +0200 From: Michael Wang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Roland Dreier , Sean Hefty , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org, netdev@vger.kernel.org CC: Hal Rosenstock , Tom Tucker , Steve Wise , Hoang-Nam Nguyen , Christoph Raisch , Mike Marciniszyn , Eli Cohen , Faisal Latif , Upinder Malhi , Trond Myklebust , "J. Bruce Fields" , "David S. Miller" , Ira Weiny , PJ Waskiewicz , Tatyana Nikolova , Or Gerlitz , Jack Morgenstein , Haggai Eran , Ilya Nelkenbaum , Yann Droneaud , Bart Van Assche , Shachar Raindel , Sagi Grimberg , Devesh Sharma , Matan Barak , Moni Shoua , Jiri Kosina , Selvin Xavier , Mitesh Ahuja , Li RongQing , Rasmus Villemoes , Alex Estrin , Doug Ledford , Eric Dumazet , Erez Shitrit , Tom Gundersen , Chuck Lever , Michael Wang Subject: [PATCH v2 17/17] IB/Verbs: Move rdma_port_get_link_layer() to mlx4 head file References: <5523CCD5.6030401@profitbricks.com> In-Reply-To: <5523CCD5.6030401@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=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 Now only mlx4 still using rdma_port_get_link_layer(), move it to it's private head file. Cc: Jason Gunthorpe Cc: Doug Ledford Cc: Ira Weiny Cc: Sean Hefty Signed-off-by: Michael Wang --- drivers/infiniband/core/verbs.c | 20 -------------------- drivers/infiniband/hw/mlx4/mlx4_ib.h | 8 ++++++++ include/rdma/ib_verbs.h | 3 --- 3 files changed, 8 insertions(+), 23 deletions(-) diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c index 49acdbc..f1eac93 100644 --- a/drivers/infiniband/core/verbs.c +++ b/drivers/infiniband/core/verbs.c @@ -107,26 +107,6 @@ __attribute_const__ int ib_rate_to_mbps(enum ib_rate rate) } EXPORT_SYMBOL(ib_rate_to_mbps); -enum rdma_link_layer rdma_port_get_link_layer(struct ib_device *device, u8 port_num) -{ - if (device->get_link_layer) - return device->get_link_layer(device, port_num); - - switch (device->query_transport(device, port_num)) { - case RDMA_TRANSPORT_IB: - case RDMA_TRANSPORT_IBOE: - return IB_LINK_LAYER_INFINIBAND; - case RDMA_TRANSPORT_IWARP: - case RDMA_TRANSPORT_USNIC: - case RDMA_TRANSPORT_USNIC_UDP: - return IB_LINK_LAYER_ETHERNET; - default: - BUG(); - return IB_LINK_LAYER_UNSPECIFIED; - } -} -EXPORT_SYMBOL(rdma_port_get_link_layer); - /* Protection domains */ struct ib_pd *ib_alloc_pd(struct ib_device *device) diff --git a/drivers/infiniband/hw/mlx4/mlx4_ib.h b/drivers/infiniband/hw/mlx4/mlx4_ib.h index 6eb743f..8e86ecc 100644 --- a/drivers/infiniband/hw/mlx4/mlx4_ib.h +++ b/drivers/infiniband/hw/mlx4/mlx4_ib.h @@ -708,6 +708,14 @@ int __mlx4_ib_query_pkey(struct ib_device *ibdev, u8 port, u16 index, int __mlx4_ib_query_gid(struct ib_device *ibdev, u8 port, int index, union ib_gid *gid, int netw_view); +static enum rdma_link_layer +rdma_port_get_link_layer(struct ib_device *device, u8 port_num) +{ + /* Will this happen? */ + BUG_ON(!device->get_link_layer); + return device->get_link_layer(device, port_num); +} + static inline bool mlx4_ib_ah_grh_present(struct mlx4_ib_ah *ah) { u8 port = be32_to_cpu(ah->av.ib.port_pd) >> 24 & 3; diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index f033f824..67b3e71 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h @@ -1742,9 +1742,6 @@ int ib_query_device(struct ib_device *device, int ib_query_port(struct ib_device *device, u8 port_num, struct ib_port_attr *port_attr); -enum rdma_link_layer rdma_port_get_link_layer(struct ib_device *device, - u8 port_num); - static inline int rdma_transport_ib(struct ib_device *device, u8 port_num) { return device->query_transport(device, port_num)