mlxsw: spectrum_switchdev: Remove VXLAN checks during FID membership
authorIdo Schimmel <idosch@mellanox.com>
Mon, 17 Feb 2020 14:29:34 +0000 (16:29 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 17 Feb 2020 22:42:53 +0000 (14:42 -0800)
As explained in previous patch, VXLAN devices now take a reference on
the FID and not only local ports. Therefore, there is no need for local
ports to check if they need to set a VNI on the FID when they join the
FID.

Remove these unnecessary checks.

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

index 3ba07233d400054a839a174126d1161f35fca993..c3a890e0bba11184f2e90544d08d86fa4b8ac8d4 100644 (file)
@@ -2108,38 +2108,8 @@ mlxsw_sp_bridge_8021q_fid_get(struct mlxsw_sp_bridge_device *bridge_device,
                              u16 vid, struct netlink_ext_ack *extack)
 {
        struct mlxsw_sp *mlxsw_sp = mlxsw_sp_lower_get(bridge_device->dev);
-       struct net_device *vxlan_dev;
-       struct mlxsw_sp_fid *fid;
-       int err;
-
-       fid = mlxsw_sp_fid_8021q_get(mlxsw_sp, vid);
-       if (IS_ERR(fid))
-               return fid;
-
-       if (mlxsw_sp_fid_vni_is_set(fid))
-               return fid;
-
-       /* Find the VxLAN device that has the specified VLAN configured as
-        * PVID and egress untagged. There can be at most one such device
-        */
-       vxlan_dev = mlxsw_sp_bridge_8021q_vxlan_dev_find(bridge_device->dev,
-                                                        vid);
-       if (!vxlan_dev)
-               return fid;
-
-       if (!netif_running(vxlan_dev))
-               return fid;
 
-       err = mlxsw_sp_bridge_8021q_vxlan_join(bridge_device, vxlan_dev, vid,
-                                              extack);
-       if (err)
-               goto err_vxlan_join;
-
-       return fid;
-
-err_vxlan_join:
-       mlxsw_sp_fid_put(fid);
-       return ERR_PTR(err);
+       return mlxsw_sp_fid_8021q_get(mlxsw_sp, vid);
 }
 
 static struct mlxsw_sp_fid *
@@ -2273,34 +2243,8 @@ mlxsw_sp_bridge_8021d_fid_get(struct mlxsw_sp_bridge_device *bridge_device,
                              u16 vid, struct netlink_ext_ack *extack)
 {
        struct mlxsw_sp *mlxsw_sp = mlxsw_sp_lower_get(bridge_device->dev);
-       struct net_device *vxlan_dev;
-       struct mlxsw_sp_fid *fid;
-       int err;
-
-       fid = mlxsw_sp_fid_8021d_get(mlxsw_sp, bridge_device->dev->ifindex);
-       if (IS_ERR(fid))
-               return fid;
-
-       if (mlxsw_sp_fid_vni_is_set(fid))
-               return fid;
-
-       vxlan_dev = mlxsw_sp_bridge_vxlan_dev_find(bridge_device->dev);
-       if (!vxlan_dev)
-               return fid;
-
-       if (!netif_running(vxlan_dev))
-               return fid;
-
-       err = mlxsw_sp_bridge_8021d_vxlan_join(bridge_device, vxlan_dev, 0,
-                                              extack);
-       if (err)
-               goto err_vxlan_join;
 
-       return fid;
-
-err_vxlan_join:
-       mlxsw_sp_fid_put(fid);
-       return ERR_PTR(err);
+       return mlxsw_sp_fid_8021d_get(mlxsw_sp, bridge_device->dev->ifindex);
 }
 
 static struct mlxsw_sp_fid *