Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp2848524pxx; Sun, 1 Nov 2020 12:18:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJy5Y8qIf7g9/l2OzHW7WMNp/no80QjjZ9UGyNukUAuhhvEM62nAMhqsUWHrz921UDJ4W3/Q X-Received: by 2002:a17:906:5e45:: with SMTP id b5mr844957eju.46.1604261912942; Sun, 01 Nov 2020 12:18:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604261912; cv=none; d=google.com; s=arc-20160816; b=nnPQsTdFha/5rDdoDcKdoUQWzlC7gXXVsMNo8TVAIO+OJiJSKz2z6cy2hhaet0D+9D Ge0WVRuot8wztUj/vk4JNh/rTNG1wYLodVt5oKPfpybXlfEpZjYz5YEXrhAeXPJruQLL E9C307P7cVrd9Cv9fHCFKxNBWHM/kdElgYZJOK1ShzoX+EcQe5f+VMZtJW4OZI1d5YwB 9jeSw1BXIjUPt6+gR+XKlHN6UBt7SBvbajQWpilBBY+YFJu4eJnxyJm46DRyyLqMTUqb xe8L5B3sqTWOSX47U1HXnPXbTui+KHTz1fIiKD0/v3EYkZ1YBWEY6CJgUpFoMDoY9aW6 o4FA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bfgZHSNdEoWNOYU40f77uswoP5Ojgv5U2Pg2QDTQYsA=; b=rXsoDk69sYZJhhwdUiUHQElOtTfN5dkIi2m1EmmCEFe390JOLYCGDJeizlfJy30BKo NQq8aHabD7XCEI8m2AS7MPZncBmbRr1SPKTy1VO4uZsj1phP/aZMfusXVbuFMIrxKqAG eEhNNefq+eiDY6JBeBWEcjidIC64s9uFKKIPqvMwrkKboW8Vb3CflFTMOWZr55iMpeaD VWVvARjzjIz1nDZc4B+7jrvBRwKvJegONQaSyxaIi10e9eW+LLp6y9kAnNw0Ro+ovfZL HoLjEwgpnV5fGHCAOiUXPPqgQ2GAwcrMOolYV6X+ZRw9Wxlmdx1Gt9sujmfPHJglnvcp dUiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HuM41gDs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p27si8555326ejf.691.2020.11.01.12.18.10; Sun, 01 Nov 2020 12:18:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HuM41gDs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727632AbgKAUQ0 (ORCPT + 99 others); Sun, 1 Nov 2020 15:16:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:58054 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727289AbgKAUQY (ORCPT ); Sun, 1 Nov 2020 15:16:24 -0500 Received: from localhost (host-213-179-129-39.customer.m-online.net [213.179.129.39]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F1A5A22253; Sun, 1 Nov 2020 20:16:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604261783; bh=Q9+DNPy01/d6QOTNLTpXmnb96hr2wRSaRSliuVZgSfw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HuM41gDsnUSP+oOKwGhvqCR8H8RP66Er0wiLHxdgacfs+Gpf9awx8liietvFpcOOk MxaypMf0W+Y5cv14JFrH03yAeA87saQiAmXDqQiSlPJoXafF6nFNnXrVlxihv3dXNz hGoki06zj7bh2hXPgvc/ArR1dcSypdVPpu3MfidA= From: Leon Romanovsky To: Doug Ledford , Jason Gunthorpe , gregkh Cc: Leon Romanovsky , Jakub Kicinski , Jason Wang , linux-rdma@vger.kernel.org, "Michael S. Tsirkin" , netdev@vger.kernel.org, Parav Pandit , Roi Dayan , Saeed Mahameed , virtualization@lists.linux-foundation.org, alsa-devel@alsa-project.org, tiwai@suse.de, broonie@kernel.org, "David S . Miller" , ranjani.sridharan@linux.intel.com, pierre-louis.bossart@linux.intel.com, fred.oh@linux.intel.com, shiraz.saleem@intel.com, dan.j.williams@intel.com, kiran.patil@intel.com, linux-kernel@vger.kernel.org Subject: [PATCH mlx5-next v1 11/11] RDMA/mlx5: Remove IB representors dead code Date: Sun, 1 Nov 2020 22:15:42 +0200 Message-Id: <20201101201542.2027568-12-leon@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201101201542.2027568-1-leon@kernel.org> References: <20201101201542.2027568-1-leon@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Leon Romanovsky Delete dead code. Signed-off-by: Leon Romanovsky --- drivers/infiniband/hw/mlx5/ib_rep.c | 31 +++++++---------------------- drivers/infiniband/hw/mlx5/ib_rep.h | 31 ----------------------------- 2 files changed, 7 insertions(+), 55 deletions(-) diff --git a/drivers/infiniband/hw/mlx5/ib_rep.c b/drivers/infiniband/hw/mlx5/ib_rep.c index 9810bdd7f3bc..a1a9450ed92c 100644 --- a/drivers/infiniband/hw/mlx5/ib_rep.c +++ b/drivers/infiniband/hw/mlx5/ib_rep.c @@ -13,7 +13,7 @@ mlx5_ib_set_vport_rep(struct mlx5_core_dev *dev, struct mlx5_eswitch_rep *rep) struct mlx5_ib_dev *ibdev; int vport_index; - ibdev = mlx5_ib_get_uplink_ibdev(dev->priv.eswitch); + ibdev = mlx5_eswitch_uplink_get_proto_dev(dev->priv.eswitch, REP_IB); vport_index = rep->vport_index; ibdev->port[vport_index].rep = rep; @@ -74,6 +74,11 @@ mlx5_ib_vport_rep_load(struct mlx5_core_dev *dev, struct mlx5_eswitch_rep *rep) return ret; } +static void *mlx5_ib_rep_to_dev(struct mlx5_eswitch_rep *rep) +{ + return rep->rep_data[REP_IB].priv; +} + static void mlx5_ib_vport_rep_unload(struct mlx5_eswitch_rep *rep) { @@ -91,40 +96,18 @@ mlx5_ib_vport_rep_unload(struct mlx5_eswitch_rep *rep) __mlx5_ib_remove(dev, dev->profile, MLX5_IB_STAGE_MAX); } -static void *mlx5_ib_vport_get_proto_dev(struct mlx5_eswitch_rep *rep) -{ - return mlx5_ib_rep_to_dev(rep); -} - static const struct mlx5_eswitch_rep_ops rep_ops = { .load = mlx5_ib_vport_rep_load, .unload = mlx5_ib_vport_rep_unload, - .get_proto_dev = mlx5_ib_vport_get_proto_dev, + .get_proto_dev = mlx5_ib_rep_to_dev, }; -struct mlx5_ib_dev *mlx5_ib_get_rep_ibdev(struct mlx5_eswitch *esw, - u16 vport_num) -{ - return mlx5_eswitch_get_proto_dev(esw, vport_num, REP_IB); -} - struct net_device *mlx5_ib_get_rep_netdev(struct mlx5_eswitch *esw, u16 vport_num) { return mlx5_eswitch_get_proto_dev(esw, vport_num, REP_ETH); } -struct mlx5_ib_dev *mlx5_ib_get_uplink_ibdev(struct mlx5_eswitch *esw) -{ - return mlx5_eswitch_uplink_get_proto_dev(esw, REP_IB); -} - -struct mlx5_eswitch_rep *mlx5_ib_vport_rep(struct mlx5_eswitch *esw, - u16 vport_num) -{ - return mlx5_eswitch_vport_rep(esw, vport_num); -} - struct mlx5_flow_handle *create_flow_rule_vport_sq(struct mlx5_ib_dev *dev, struct mlx5_ib_sq *sq, u16 port) diff --git a/drivers/infiniband/hw/mlx5/ib_rep.h b/drivers/infiniband/hw/mlx5/ib_rep.h index 93f562735e89..ce1dcb105dbd 100644 --- a/drivers/infiniband/hw/mlx5/ib_rep.h +++ b/drivers/infiniband/hw/mlx5/ib_rep.h @@ -12,11 +12,6 @@ extern const struct mlx5_ib_profile raw_eth_profile; #ifdef CONFIG_MLX5_ESWITCH -struct mlx5_ib_dev *mlx5_ib_get_rep_ibdev(struct mlx5_eswitch *esw, - u16 vport_num); -struct mlx5_ib_dev *mlx5_ib_get_uplink_ibdev(struct mlx5_eswitch *esw); -struct mlx5_eswitch_rep *mlx5_ib_vport_rep(struct mlx5_eswitch *esw, - u16 vport_num); int mlx5r_rep_init(void); void mlx5r_rep_cleanup(void); struct mlx5_flow_handle *create_flow_rule_vport_sq(struct mlx5_ib_dev *dev, @@ -25,26 +20,6 @@ struct mlx5_flow_handle *create_flow_rule_vport_sq(struct mlx5_ib_dev *dev, struct net_device *mlx5_ib_get_rep_netdev(struct mlx5_eswitch *esw, u16 vport_num); #else /* CONFIG_MLX5_ESWITCH */ -static inline -struct mlx5_ib_dev *mlx5_ib_get_rep_ibdev(struct mlx5_eswitch *esw, - u16 vport_num) -{ - return NULL; -} - -static inline -struct mlx5_ib_dev *mlx5_ib_get_uplink_ibdev(struct mlx5_eswitch *esw) -{ - return NULL; -} - -static inline -struct mlx5_eswitch_rep *mlx5_ib_vport_rep(struct mlx5_eswitch *esw, - u16 vport_num) -{ - return NULL; -} - static inline int mlx5r_rep_init(void) { return 0; } static inline void mlx5r_rep_cleanup(void) {} static inline @@ -62,10 +37,4 @@ struct net_device *mlx5_ib_get_rep_netdev(struct mlx5_eswitch *esw, return NULL; } #endif - -static inline -struct mlx5_ib_dev *mlx5_ib_rep_to_dev(struct mlx5_eswitch_rep *rep) -{ - return rep->rep_data[REP_IB].priv; -} #endif /* __MLX5_IB_REP_H__ */ -- 2.28.0