]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mlxsw: spectrum_switchdev: Move mlxsw_sp_bridge_vxlan_join()
authorAmit Cohen <amcohen@nvidia.com>
Mon, 17 Mar 2025 17:37:29 +0000 (18:37 +0100)
committerJakub Kicinski <kuba@kernel.org>
Mon, 24 Mar 2025 22:09:31 +0000 (15:09 -0700)
Next patch will call __mlxsw_sp_bridge_vxlan_leave() from
mlxsw_sp_bridge_vxlan_join() as part of error flow, move the function to
be able to call the second one.

Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/64750a0965536530482318578bada30fac372b8a.1742224300.git.petrm@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c

index c95ef79eaf3d65b3d8ccb00a13b533e74be776b0..13ad4e31d7012bc08fc411a14584c82942268123 100644 (file)
@@ -2929,21 +2929,6 @@ void mlxsw_sp_port_bridge_leave(struct mlxsw_sp_port *mlxsw_sp_port,
        mlxsw_sp_bridge_port_put(mlxsw_sp->bridge, bridge_port);
 }
 
-int mlxsw_sp_bridge_vxlan_join(struct mlxsw_sp *mlxsw_sp,
-                              const struct net_device *br_dev,
-                              const struct net_device *vxlan_dev, u16 vid,
-                              struct netlink_ext_ack *extack)
-{
-       struct mlxsw_sp_bridge_device *bridge_device;
-
-       bridge_device = mlxsw_sp_bridge_device_find(mlxsw_sp->bridge, br_dev);
-       if (WARN_ON(!bridge_device))
-               return -EINVAL;
-
-       return bridge_device->ops->vxlan_join(bridge_device, vxlan_dev, vid,
-                                             extack);
-}
-
 static void __mlxsw_sp_bridge_vxlan_leave(struct mlxsw_sp *mlxsw_sp,
                                          const struct net_device *vxlan_dev)
 {
@@ -2963,6 +2948,21 @@ static void __mlxsw_sp_bridge_vxlan_leave(struct mlxsw_sp *mlxsw_sp,
        mlxsw_sp_fid_put(fid);
 }
 
+int mlxsw_sp_bridge_vxlan_join(struct mlxsw_sp *mlxsw_sp,
+                              const struct net_device *br_dev,
+                              const struct net_device *vxlan_dev, u16 vid,
+                              struct netlink_ext_ack *extack)
+{
+       struct mlxsw_sp_bridge_device *bridge_device;
+
+       bridge_device = mlxsw_sp_bridge_device_find(mlxsw_sp->bridge, br_dev);
+       if (WARN_ON(!bridge_device))
+               return -EINVAL;
+
+       return bridge_device->ops->vxlan_join(bridge_device, vxlan_dev, vid,
+                                             extack);
+}
+
 void mlxsw_sp_bridge_vxlan_leave(struct mlxsw_sp *mlxsw_sp,
                                 const struct net_device *vxlan_dev)
 {