]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net: Get rid of switchdev_port_attr_get()
authorFlorian Fainelli <f.fainelli@gmail.com>
Thu, 21 Feb 2019 00:58:26 +0000 (16:58 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 21 Feb 2019 22:55:14 +0000 (14:55 -0800)
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 <f.fainelli@gmail.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Documentation/networking/switchdev.txt
drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
drivers/net/ethernet/rocker/rocker_main.c
drivers/staging/fsl-dpaa2/ethsw/ethsw.c
include/net/switchdev.h
net/dsa/slave.c

index 79c8b0f16aeecf84c92eb560e394a1e57c743a5c..413abbae952f22c43d5184e3059a793ee720d6c6 100644 (file)
@@ -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
 ^^^^^^^^^^
index bbb5a406232ee279e37fc022b277a254b673193c..766f5b5f1cf528edf89ddd7f26b14f1dcf9b76cd 100644 (file)
@@ -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,
 };
 
index 6b8273e2057d50a7947dfb005dba6ca1fca3e350..8200fbf9130629303f5655690428aa7cc6898438 100644 (file)
@@ -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,
 };
 
index de4dcabbc29ab4cb43c6b0c71593f536148b3bdb..018399ee873181412509972466b5ce2ccd37e33c 100644 (file)
@@ -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,
 };
 
index 0f352019ef992238b2fdb853fda57f3c9ea6cc98..45310ddf2d7efdecca463ed7ce9438ab2fc16617 100644 (file)
@@ -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)
 {
index db0a2651070f5d69ad452a7a27e3566d1725310b..a78b2bba0332235aff716d9bc87454e5cb75d030 100644 (file)
@@ -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,
 };