Skip to content

Commit 630e7e2

Browse files
Amit Cohenkuba-moo
authored andcommitted
mlxsw: spectrum_switchdev: Move mlxsw_sp_bridge_vxlan_join()
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 <[email protected]> Reviewed-by: Petr Machata <[email protected]> Reviewed-by: Ido Schimmel <[email protected]> Signed-off-by: Petr Machata <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/64750a0965536530482318578bada30fac372b8a.1742224300.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 413e2c0 commit 630e7e2

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2929,21 +2929,6 @@ void mlxsw_sp_port_bridge_leave(struct mlxsw_sp_port *mlxsw_sp_port,
29292929
mlxsw_sp_bridge_port_put(mlxsw_sp->bridge, bridge_port);
29302930
}
29312931

2932-
int mlxsw_sp_bridge_vxlan_join(struct mlxsw_sp *mlxsw_sp,
2933-
const struct net_device *br_dev,
2934-
const struct net_device *vxlan_dev, u16 vid,
2935-
struct netlink_ext_ack *extack)
2936-
{
2937-
struct mlxsw_sp_bridge_device *bridge_device;
2938-
2939-
bridge_device = mlxsw_sp_bridge_device_find(mlxsw_sp->bridge, br_dev);
2940-
if (WARN_ON(!bridge_device))
2941-
return -EINVAL;
2942-
2943-
return bridge_device->ops->vxlan_join(bridge_device, vxlan_dev, vid,
2944-
extack);
2945-
}
2946-
29472932
static void __mlxsw_sp_bridge_vxlan_leave(struct mlxsw_sp *mlxsw_sp,
29482933
const struct net_device *vxlan_dev)
29492934
{
@@ -2963,6 +2948,21 @@ static void __mlxsw_sp_bridge_vxlan_leave(struct mlxsw_sp *mlxsw_sp,
29632948
mlxsw_sp_fid_put(fid);
29642949
}
29652950

2951+
int mlxsw_sp_bridge_vxlan_join(struct mlxsw_sp *mlxsw_sp,
2952+
const struct net_device *br_dev,
2953+
const struct net_device *vxlan_dev, u16 vid,
2954+
struct netlink_ext_ack *extack)
2955+
{
2956+
struct mlxsw_sp_bridge_device *bridge_device;
2957+
2958+
bridge_device = mlxsw_sp_bridge_device_find(mlxsw_sp->bridge, br_dev);
2959+
if (WARN_ON(!bridge_device))
2960+
return -EINVAL;
2961+
2962+
return bridge_device->ops->vxlan_join(bridge_device, vxlan_dev, vid,
2963+
extack);
2964+
}
2965+
29662966
void mlxsw_sp_bridge_vxlan_leave(struct mlxsw_sp *mlxsw_sp,
29672967
const struct net_device *vxlan_dev)
29682968
{

0 commit comments

Comments
 (0)