net: dsa: pass extack to dsa_port_{bridge,lag}_join
authorVladimir Oltean <vladimir.oltean@nxp.com>
Mon, 22 Mar 2021 23:51:48 +0000 (01:51 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 23 Mar 2021 21:49:05 +0000 (14:49 -0700)
This is a pretty noisy change that was broken out of the larger change
for replaying switchdev attributes and objects at bridge join time,
which is when these extack objects are actually used.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Tobias Waldekranz <tobias@waldekranz.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dsa/dsa_priv.h
net/dsa/port.c
net/dsa/slave.c

index 4c43c54..b8778c5 100644 (file)
@@ -181,12 +181,14 @@ int dsa_port_enable_rt(struct dsa_port *dp, struct phy_device *phy);
 int dsa_port_enable(struct dsa_port *dp, struct phy_device *phy);
 void dsa_port_disable_rt(struct dsa_port *dp);
 void dsa_port_disable(struct dsa_port *dp);
-int dsa_port_bridge_join(struct dsa_port *dp, struct net_device *br);
+int dsa_port_bridge_join(struct dsa_port *dp, struct net_device *br,
+                        struct netlink_ext_ack *extack);
 void dsa_port_bridge_leave(struct dsa_port *dp, struct net_device *br);
 int dsa_port_lag_change(struct dsa_port *dp,
                        struct netdev_lag_lower_state_info *linfo);
 int dsa_port_lag_join(struct dsa_port *dp, struct net_device *lag_dev,
-                     struct netdev_lag_upper_info *uinfo);
+                     struct netdev_lag_upper_info *uinfo,
+                     struct netlink_ext_ack *extack);
 void dsa_port_lag_leave(struct dsa_port *dp, struct net_device *lag_dev);
 int dsa_port_vlan_filtering(struct dsa_port *dp, bool vlan_filtering,
                            struct netlink_ext_ack *extack);
index d39262a..fcbe5b1 100644 (file)
@@ -144,7 +144,8 @@ static void dsa_port_change_brport_flags(struct dsa_port *dp,
        }
 }
 
-int dsa_port_bridge_join(struct dsa_port *dp, struct net_device *br)
+int dsa_port_bridge_join(struct dsa_port *dp, struct net_device *br,
+                        struct netlink_ext_ack *extack)
 {
        struct dsa_notifier_bridge_info info = {
                .tree_index = dp->ds->dst->index,
@@ -241,7 +242,8 @@ int dsa_port_lag_change(struct dsa_port *dp,
 }
 
 int dsa_port_lag_join(struct dsa_port *dp, struct net_device *lag,
-                     struct netdev_lag_upper_info *uinfo)
+                     struct netdev_lag_upper_info *uinfo,
+                     struct netlink_ext_ack *extack)
 {
        struct dsa_notifier_lag_info info = {
                .sw_index = dp->ds->index,
@@ -263,7 +265,7 @@ int dsa_port_lag_join(struct dsa_port *dp, struct net_device *lag,
        if (!bridge_dev || !netif_is_bridge_master(bridge_dev))
                return 0;
 
-       err = dsa_port_bridge_join(dp, bridge_dev);
+       err = dsa_port_bridge_join(dp, bridge_dev, extack);
        if (err)
                goto err_bridge_join;
 
index 992fcab..1ff48be 100644 (file)
@@ -1976,11 +1976,14 @@ static int dsa_slave_changeupper(struct net_device *dev,
                                 struct netdev_notifier_changeupper_info *info)
 {
        struct dsa_port *dp = dsa_slave_to_port(dev);
+       struct netlink_ext_ack *extack;
        int err = NOTIFY_DONE;
 
+       extack = netdev_notifier_info_to_extack(&info->info);
+
        if (netif_is_bridge_master(info->upper_dev)) {
                if (info->linking) {
-                       err = dsa_port_bridge_join(dp, info->upper_dev);
+                       err = dsa_port_bridge_join(dp, info->upper_dev, extack);
                        if (!err)
                                dsa_bridge_mtu_normalization(dp);
                        err = notifier_from_errno(err);
@@ -1991,7 +1994,7 @@ static int dsa_slave_changeupper(struct net_device *dev,
        } else if (netif_is_lag_master(info->upper_dev)) {
                if (info->linking) {
                        err = dsa_port_lag_join(dp, info->upper_dev,
-                                               info->upper_info);
+                                               info->upper_info, extack);
                        if (err == -EOPNOTSUPP) {
                                NL_SET_ERR_MSG_MOD(info->info.extack,
                                                   "Offloading not supported");