History

net: Get rid of switchdev_port_attr_get()

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.

Florian Fainelli committed 7 years ago

Commit 010c8f01 parent cc0c2076 files · +1 −37Browse files

Unified · Split

6 files
  1. Documentation/networking/switchdev.txt +1 −1
  2. drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c +0 −7
  3. drivers/net/ethernet/rocker/rocker_main.c +0 −7
  4. drivers/staging/fsl-dpaa2/ethsw/ethsw.c +0 −7
  5. include/net/switchdev.h +0 −8
  6. net/dsa/slave.c +0 −7
Documentation/networking/switchdev.txt+1−1
@@ -233,7 +233,7 @@ the bridge's FDB. It's possible, but not optimal, to enable learning on the · 232 unmodified lines
233233 device port and on the bridge port, and disable learning_sync.
234234
235235 To support learning, the driver implements switchdev op
236−switchdev_port_attr_get/set for SWITCHDEV_ATTR_PORT_ID_BRIDGE_FLAGS.
236+switchdev_port_attr_set for SWITCHDEV_ATTR_PORT_ID_{PRE}_BRIDGE_FLAGS.
237237
238238 FDB Ageing
239239 ^^^^^^^^^^
drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c+0−7
@@ -431,12 +431,6 @@ static void mlxsw_sp_bridge_vlan_put(struct mlxsw_sp_bridge_vlan *bridge_vlan) · 430 unmodified lines
431431 mlxsw_sp_bridge_vlan_destroy(bridge_vlan);
432432 }
433433
434−static int mlxsw_sp_port_attr_get(struct net_device *dev,
435− struct switchdev_attr *attr)
436−{
437− return -EOPNOTSUPP;
438−}
439−
440434 static int
441435 mlxsw_sp_port_bridge_vlan_stp_set(struct mlxsw_sp_port *mlxsw_sp_port,
442436 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, · 1502 unmodified lines
19451939 }
19461940
19471941 static const struct switchdev_ops mlxsw_sp_port_switchdev_ops = {
1948− .switchdev_port_attr_get = mlxsw_sp_port_attr_get,
19491942 .switchdev_port_attr_set = mlxsw_sp_port_attr_set,
19501943 };
19511944
drivers/net/ethernet/rocker/rocker_main.c+0−7
@@ -2066,12 +2066,6 @@ static const struct net_device_ops rocker_port_netdev_ops = { · 2065 unmodified lines
20662066 * swdev interface
20672067 ********************/
20682068
2069−static int rocker_port_attr_get(struct net_device *dev,
2070− struct switchdev_attr *attr)
2071−{
2072− return -EOPNOTSUPP;
2073−}
2074−
20752069 static int rocker_port_attr_set(struct net_device *dev,
20762070 const struct switchdev_attr *attr,
20772071 struct switchdev_trans *trans)
@@ -2148,7 +2142,6 @@ static int rocker_port_obj_del(struct net_device *dev, · 70 unmodified lines
21482142 }
21492143
21502144 static const struct switchdev_ops rocker_port_switchdev_ops = {
2151− .switchdev_port_attr_get = rocker_port_attr_get,
21522145 .switchdev_port_attr_set = rocker_port_attr_set,
21532146 };
21542147
drivers/staging/fsl-dpaa2/ethsw/ethsw.c+0−7
@@ -640,12 +640,6 @@ static void ethsw_teardown_irqs(struct fsl_mc_device *sw_dev) · 639 unmodified lines
640640 fsl_mc_free_irqs(sw_dev);
641641 }
642642
643−static int swdev_port_attr_get(struct net_device *netdev,
644− struct switchdev_attr *attr)
645−{
646− return -EOPNOTSUPP;
647−}
648−
649643 static int port_attr_stp_state_set(struct net_device *netdev,
650644 struct switchdev_trans *trans,
651645 u8 state)
@@ -932,7 +926,6 @@ static int swdev_port_obj_del(struct net_device *netdev, · 280 unmodified lines
932926 }
933927
934928 static const struct switchdev_ops ethsw_port_switchdev_ops = {
935− .switchdev_port_attr_get = swdev_port_attr_get,
936929 .switchdev_port_attr_set = swdev_port_attr_set,
937930 };
938931
include/net/switchdev.h+0−8
@@ -179,8 +179,6 @@ switchdev_notifier_info_to_extack(const struct switchdev_notifier_info *info) · 178 unmodified lines
179179 #ifdef CONFIG_NET_SWITCHDEV
180180
181181 void switchdev_deferred_process(void);
182−int switchdev_port_attr_get(struct net_device *dev,
183− struct switchdev_attr *attr);
184182 int switchdev_port_attr_set(struct net_device *dev,
185183 const struct switchdev_attr *attr);
186184 int switchdev_port_obj_add(struct net_device *dev,
@@ -225,12 +223,6 @@ static inline void switchdev_deferred_process(void) · 38 unmodified lines
225223 {
226224 }
227225
228−static inline int switchdev_port_attr_get(struct net_device *dev,
229− struct switchdev_attr *attr)
230−{
231− return -EOPNOTSUPP;
232−}
233−
234226 static inline int switchdev_port_attr_set(struct net_device *dev,
235227 const struct switchdev_attr *attr)
236228 {
net/dsa/slave.c+0−7
@@ -385,12 +385,6 @@ static int dsa_slave_get_port_parent_id(struct net_device *dev, · 384 unmodified lines
385385 return 0;
386386 }
387387
388−static int dsa_slave_port_attr_get(struct net_device *dev,
389− struct switchdev_attr *attr)
390−{
391− return -EOPNOTSUPP;
392−}
393−
394388 static inline netdev_tx_t dsa_slave_netpoll_send_skb(struct net_device *dev,
395389 struct sk_buff *skb)
396390 {
@@ -1057,7 +1051,6 @@ static const struct net_device_ops dsa_slave_netdev_ops = { · 660 unmodified lines
10571051 };
10581052
10591053 static const struct switchdev_ops dsa_slave_switchdev_ops = {
1060− .switchdev_port_attr_get = dsa_slave_port_attr_get,
10611054 .switchdev_port_attr_set = dsa_slave_port_attr_set,
10621055 };
10631056