OSDN Git Service

mlxsw: spectrum_switchdev: Propagate extack on VXLAN VLAN events
authorPetr Machata <petrm@mellanox.com>
Wed, 12 Dec 2018 17:03:00 +0000 (17:03 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 13 Dec 2018 00:34:22 +0000 (16:34 -0800)
Now that VLAN port object addition notifications carry an extack,
propagate it from mlxsw_sp_switchdev_vxlan_vlans_add() through
mlxsw_sp_switchdev_vxlan_vlan_add() to
mlxsw_sp_bridge_8021q_vxlan_join().

This code path is used when a VLAN is added to a VXLAN netdevice that
cannot be offloaded.

Signed-off-by: Petr Machata <petrm@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c

index 4b92922..906dfde 100644 (file)
@@ -3205,7 +3205,8 @@ mlxsw_sp_switchdev_vxlan_vlan_add(struct mlxsw_sp *mlxsw_sp,
                                  struct mlxsw_sp_bridge_device *bridge_device,
                                  const struct net_device *vxlan_dev, u16 vid,
                                  bool flag_untagged, bool flag_pvid,
-                                 struct switchdev_trans *trans)
+                                 struct switchdev_trans *trans,
+                                 struct netlink_ext_ack *extack)
 {
        struct vxlan_dev *vxlan = netdev_priv(vxlan_dev);
        __be32 vni = vxlan->cfg.vni;
@@ -3237,7 +3238,7 @@ mlxsw_sp_switchdev_vxlan_vlan_add(struct mlxsw_sp *mlxsw_sp,
                if (!flag_untagged || !flag_pvid)
                        return 0;
                return mlxsw_sp_bridge_8021q_vxlan_join(bridge_device,
-                                                       vxlan_dev, vid, NULL);
+                                                       vxlan_dev, vid, extack);
        }
 
        /* Second case: FID is associated with the VNI and the VLAN associated
@@ -3277,7 +3278,7 @@ mlxsw_sp_switchdev_vxlan_vlan_add(struct mlxsw_sp *mlxsw_sp,
                return 0;
 
        err = mlxsw_sp_bridge_8021q_vxlan_join(bridge_device, vxlan_dev, vid,
-                                              NULL);
+                                              extack);
        if (err)
                goto err_vxlan_join;
 
@@ -3326,10 +3327,12 @@ mlxsw_sp_switchdev_vxlan_vlans_add(struct net_device *vxlan_dev,
        bool flag_pvid = vlan->flags & BRIDGE_VLAN_INFO_PVID;
        struct switchdev_trans *trans = port_obj_info->trans;
        struct mlxsw_sp_bridge_device *bridge_device;
+       struct netlink_ext_ack *extack;
        struct mlxsw_sp *mlxsw_sp;
        struct net_device *br_dev;
        u16 vid;
 
+       extack = switchdev_notifier_info_to_extack(&port_obj_info->info);
        br_dev = netdev_master_upper_dev_get(vxlan_dev);
        if (!br_dev)
                return 0;
@@ -3353,7 +3356,8 @@ mlxsw_sp_switchdev_vxlan_vlans_add(struct net_device *vxlan_dev,
                err = mlxsw_sp_switchdev_vxlan_vlan_add(mlxsw_sp, bridge_device,
                                                        vxlan_dev, vid,
                                                        flag_untagged,
-                                                       flag_pvid, trans);
+                                                       flag_pvid, trans,
+                                                       extack);
                if (err)
                        return err;
        }