Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp171156imp; Wed, 20 Feb 2019 17:00:11 -0800 (PST) X-Google-Smtp-Source: AHgI3IZr18zWXqRqzMub0xOnNWrCX2CGW0N1E/Ys4IXPeM2ChC1Qj1Vl36Gjt6kjd8b+D062zgiG X-Received: by 2002:a63:8b42:: with SMTP id j63mr2608613pge.79.1550710811170; Wed, 20 Feb 2019 17:00:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550710811; cv=none; d=google.com; s=arc-20160816; b=Xl8v1pSklixfsVT5GoVK5pDkPJgx4dMCuiiC9m1A33QvPgizV5PklZfVhEYIFAe/gc 9Ivk0qaHbuewiTxX0Vaqnbpsj1l2qyOHMwsl5gpisybl93SkWJGxepZMzaGp9PIxcB6v qvD1cdg7Yzj2speDDvkhDwz3ya1Fl3tXvxsO+k/3zA6FHujcB9f7tVX1HvgQZy/nN0wd cm5VCAn/1moJiLQOg51hfb0ZqnN0PTL9UogXRagsDZmWPIXEoe/3AFMJ9pRznLUuWNCs dsAGyCi474X0GD9scxRumV6YEk8Wysg2kIStNP2/n6lQRz4QdfQwuVHod8yJT0x8KR3O ArAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=6QC5/F+Bhjh0KmzSrlZ+HZJwrQWKGEwgIVPrdI/j5Fk=; b=BrvPU04TrACQA3s+5UImGOfICMTXtYZE3ioH+nPcK/jJRLc4krkiQz0IklpwwQMzdK gnDy3v0MoWMIzbXKVSpK/wOrVQw6TpUVv+tnSiKGwI0hW+AMJA1zoPb1AED/dVyrc7O/ xh0tNZgQ4c+wiZ1P7cdnRcTJUHFaUk0iW0p8663zc38zi4drAOVtH3fvsQVSlcKp97JC CDpFkTqPw7nvlD84/SSgTh3wAFqaUbUrJPc4RUFHLzgHx0TMRFIgHNGlKXBa3PF8hlpB U/csES8t3T6ydZu5MRiN0POKxJLEZa+wtwzT0W5kvYHq+7MnDoba6D6AiBMPDhXlkQdu JKOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=q+iYOTUF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n8si4669439pgq.119.2019.02.20.16.59.56; Wed, 20 Feb 2019 17:00:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=q+iYOTUF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727339AbfBUA7M (ORCPT + 99 others); Wed, 20 Feb 2019 19:59:12 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:43833 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725875AbfBUA7L (ORCPT ); Wed, 20 Feb 2019 19:59:11 -0500 Received: by mail-pf1-f193.google.com with SMTP id q17so12820275pfh.10; Wed, 20 Feb 2019 16:59:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6QC5/F+Bhjh0KmzSrlZ+HZJwrQWKGEwgIVPrdI/j5Fk=; b=q+iYOTUFVVNCE/YjQlv9P+/4efhkqAwqst44r8uQC6fs9tMVi6OZD7R39iLBP3FEx5 3f0mlCUyOE1gyTasSbQXTdACuXOetL1uOG7n6V8ebZjJK1qg4QFx7qxXYRTSj2FUEgw1 L6BnUMvvIhJ5V1tT/5GYrzdv5YRrAqzk92PLSCTpiz+yz67QpKtTVHixfUZ+mho+9q6E VjH0BwCAXbQ66Om3+XfoHuogSEQ4OzQngejlF+bGCnPxoLtX5cu3LlWVph89KLuTHnRS Zk85UqaTP7IWjWMQA0fcXUyLkeVXEZrsgOaus5Zb9uSvCYOuFtN0t684sa8V/kglcoLa 9+DQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=6QC5/F+Bhjh0KmzSrlZ+HZJwrQWKGEwgIVPrdI/j5Fk=; b=qaIci4trUTTjpKkXynBtl6RfaAfrOvesjBZt9Dmvo3NlBlkTHwdlJMHwudiOtHKAdA SBtDu3xcaBpOTtSQtDVLI7SQoJGOtxnivJKM2wQ6XZUbYXOearpxOhewAvQ7f5hUT1TU BuwPcdiwvC/QAPAPUVoqJGOaXDS+QpmXlZL4TWmAoiSsZmZg3XVhlVhGNfJY9wo81siM X9D+08fXZJtVnlR6dadHT4L8XzEvfNQR1zuXdHUHvzVjGS88mk3ls8fslrS02XQwTHoF yNWZ1eudP9V7G2QSu54x+1ouhtClGovrW7PeJ8mZfmD8fv1sWHPy1aWFi/CbPkO9UWbN pAlQ== X-Gm-Message-State: AHQUAuYRL/rYgbKJrgKWRLWWq7IzFnYevWdHsS2rRxaRkmC+bmtIE7L+ vKs6ChEoC9W6MUa1HLPFNyKEt9Br X-Received: by 2002:a62:aa08:: with SMTP id e8mr24816673pff.139.1550710749643; Wed, 20 Feb 2019 16:59:09 -0800 (PST) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id z15sm17203255pgc.25.2019.02.20.16.59.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Feb 2019 16:59:08 -0800 (PST) From: Florian Fainelli To: netdev@vger.kernel.org Cc: Florian Fainelli , "David S. Miller" , Ido Schimmel , linux-kernel@vger.kernel.org (open list), devel@driverdev.osuosl.org (open list:STAGING SUBSYSTEM), bridge@lists.linux-foundation.org (moderated list:ETHERNET BRIDGE), jiri@mellanox.com, andrew@lunn.ch, vivien.didelot@gmail.com Subject: [PATCH net-next v3 8/8] net: Get rid of switchdev_port_attr_get() Date: Wed, 20 Feb 2019 16:58:26 -0800 Message-Id: <20190221005826.26317-9-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190221005826.26317-1-f.fainelli@gmail.com> References: <20190221005826.26317-1-f.fainelli@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With the bridge no longer calling switchdev_port_attr_get() to obtain the supported bridge port flags from a driver but instead trying to set the bridge port flags directly and relying on driver to reject unsupported configurations, we can effectively get rid of switchdev_port_attr_get() entirely since this was the only place where it was called. Signed-off-by: Florian Fainelli --- Documentation/networking/switchdev.txt | 2 +- drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c | 7 ------- drivers/net/ethernet/rocker/rocker_main.c | 7 ------- drivers/staging/fsl-dpaa2/ethsw/ethsw.c | 7 ------- include/net/switchdev.h | 8 -------- net/dsa/slave.c | 7 ------- 6 files changed, 1 insertion(+), 37 deletions(-) diff --git a/Documentation/networking/switchdev.txt b/Documentation/networking/switchdev.txt index 79c8b0f16aee..413abbae952f 100644 --- a/Documentation/networking/switchdev.txt +++ b/Documentation/networking/switchdev.txt @@ -233,7 +233,7 @@ the bridge's FDB. It's possible, but not optimal, to enable learning on the device port and on the bridge port, and disable learning_sync. To support learning, the driver implements switchdev op -switchdev_port_attr_get/set for SWITCHDEV_ATTR_PORT_ID_BRIDGE_FLAGS. +switchdev_port_attr_set for SWITCHDEV_ATTR_PORT_ID_{PRE}_BRIDGE_FLAGS. FDB Ageing ^^^^^^^^^^ diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c index bbb5a406232e..766f5b5f1cf5 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c @@ -431,12 +431,6 @@ static void mlxsw_sp_bridge_vlan_put(struct mlxsw_sp_bridge_vlan *bridge_vlan) mlxsw_sp_bridge_vlan_destroy(bridge_vlan); } -static int mlxsw_sp_port_attr_get(struct net_device *dev, - struct switchdev_attr *attr) -{ - return -EOPNOTSUPP; -} - static int mlxsw_sp_port_bridge_vlan_stp_set(struct mlxsw_sp_port *mlxsw_sp_port, struct mlxsw_sp_bridge_vlan *bridge_vlan, @@ -1945,7 +1939,6 @@ static struct mlxsw_sp_port *mlxsw_sp_lag_rep_port(struct mlxsw_sp *mlxsw_sp, } static const struct switchdev_ops mlxsw_sp_port_switchdev_ops = { - .switchdev_port_attr_get = mlxsw_sp_port_attr_get, .switchdev_port_attr_set = mlxsw_sp_port_attr_set, }; diff --git a/drivers/net/ethernet/rocker/rocker_main.c b/drivers/net/ethernet/rocker/rocker_main.c index 6b8273e2057d..8200fbf91306 100644 --- a/drivers/net/ethernet/rocker/rocker_main.c +++ b/drivers/net/ethernet/rocker/rocker_main.c @@ -2066,12 +2066,6 @@ static const struct net_device_ops rocker_port_netdev_ops = { * swdev interface ********************/ -static int rocker_port_attr_get(struct net_device *dev, - struct switchdev_attr *attr) -{ - return -EOPNOTSUPP; -} - static int rocker_port_attr_set(struct net_device *dev, const struct switchdev_attr *attr, struct switchdev_trans *trans) @@ -2148,7 +2142,6 @@ static int rocker_port_obj_del(struct net_device *dev, } static const struct switchdev_ops rocker_port_switchdev_ops = { - .switchdev_port_attr_get = rocker_port_attr_get, .switchdev_port_attr_set = rocker_port_attr_set, }; diff --git a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c index de4dcabbc29a..018399ee8731 100644 --- a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c +++ b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c @@ -640,12 +640,6 @@ static void ethsw_teardown_irqs(struct fsl_mc_device *sw_dev) fsl_mc_free_irqs(sw_dev); } -static int swdev_port_attr_get(struct net_device *netdev, - struct switchdev_attr *attr) -{ - return -EOPNOTSUPP; -} - static int port_attr_stp_state_set(struct net_device *netdev, struct switchdev_trans *trans, u8 state) @@ -932,7 +926,6 @@ static int swdev_port_obj_del(struct net_device *netdev, } static const struct switchdev_ops ethsw_port_switchdev_ops = { - .switchdev_port_attr_get = swdev_port_attr_get, .switchdev_port_attr_set = swdev_port_attr_set, }; diff --git a/include/net/switchdev.h b/include/net/switchdev.h index 0f352019ef99..45310ddf2d7e 100644 --- a/include/net/switchdev.h +++ b/include/net/switchdev.h @@ -179,8 +179,6 @@ switchdev_notifier_info_to_extack(const struct switchdev_notifier_info *info) #ifdef CONFIG_NET_SWITCHDEV void switchdev_deferred_process(void); -int switchdev_port_attr_get(struct net_device *dev, - struct switchdev_attr *attr); int switchdev_port_attr_set(struct net_device *dev, const struct switchdev_attr *attr); int switchdev_port_obj_add(struct net_device *dev, @@ -225,12 +223,6 @@ static inline void switchdev_deferred_process(void) { } -static inline int switchdev_port_attr_get(struct net_device *dev, - struct switchdev_attr *attr) -{ - return -EOPNOTSUPP; -} - static inline int switchdev_port_attr_set(struct net_device *dev, const struct switchdev_attr *attr) { diff --git a/net/dsa/slave.c b/net/dsa/slave.c index db0a2651070f..a78b2bba0332 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -385,12 +385,6 @@ static int dsa_slave_get_port_parent_id(struct net_device *dev, return 0; } -static int dsa_slave_port_attr_get(struct net_device *dev, - struct switchdev_attr *attr) -{ - return -EOPNOTSUPP; -} - static inline netdev_tx_t dsa_slave_netpoll_send_skb(struct net_device *dev, struct sk_buff *skb) { @@ -1057,7 +1051,6 @@ static const struct net_device_ops dsa_slave_netdev_ops = { }; static const struct switchdev_ops dsa_slave_switchdev_ops = { - .switchdev_port_attr_get = dsa_slave_port_attr_get, .switchdev_port_attr_set = dsa_slave_port_attr_set, }; -- 2.17.1