Skip to content

Commit 6698c16

Browse files
pmachatadavem330
authored andcommitted
mlxsw: spectrum_router: Move mlxsw_sp_netdev_ipip_type()
Signed-off-by: Petr Machata <[email protected]> Reviewed-by: Ido Schimmel <[email protected]> Signed-off-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c30f5d0 commit 6698c16

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

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

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,6 +1295,25 @@ mlxsw_sp_ipip_entry_find_by_decap(struct mlxsw_sp *mlxsw_sp,
12951295
return NULL;
12961296
}
12971297

1298+
static bool mlxsw_sp_netdev_ipip_type(const struct mlxsw_sp *mlxsw_sp,
1299+
const struct net_device *dev,
1300+
enum mlxsw_sp_ipip_type *p_type)
1301+
{
1302+
struct mlxsw_sp_router *router = mlxsw_sp->router;
1303+
const struct mlxsw_sp_ipip_ops *ipip_ops;
1304+
enum mlxsw_sp_ipip_type ipipt;
1305+
1306+
for (ipipt = 0; ipipt < MLXSW_SP_IPIP_TYPE_MAX; ++ipipt) {
1307+
ipip_ops = router->ipip_ops_arr[ipipt];
1308+
if (dev->type == ipip_ops->dev_type) {
1309+
if (p_type)
1310+
*p_type = ipipt;
1311+
return true;
1312+
}
1313+
}
1314+
return false;
1315+
}
1316+
12981317
struct mlxsw_sp_neigh_key {
12991318
struct neighbour *n;
13001319
};
@@ -2785,25 +2804,6 @@ static void mlxsw_sp_nexthop_neigh_fini(struct mlxsw_sp *mlxsw_sp,
27852804
neigh_release(n);
27862805
}
27872806

2788-
static bool mlxsw_sp_netdev_ipip_type(const struct mlxsw_sp *mlxsw_sp,
2789-
const struct net_device *dev,
2790-
enum mlxsw_sp_ipip_type *p_type)
2791-
{
2792-
struct mlxsw_sp_router *router = mlxsw_sp->router;
2793-
const struct mlxsw_sp_ipip_ops *ipip_ops;
2794-
enum mlxsw_sp_ipip_type ipipt;
2795-
2796-
for (ipipt = 0; ipipt < MLXSW_SP_IPIP_TYPE_MAX; ++ipipt) {
2797-
ipip_ops = router->ipip_ops_arr[ipipt];
2798-
if (dev->type == ipip_ops->dev_type) {
2799-
if (p_type)
2800-
*p_type = ipipt;
2801-
return true;
2802-
}
2803-
}
2804-
return false;
2805-
}
2806-
28072807
static int mlxsw_sp_nexthop_ipip_init(struct mlxsw_sp *mlxsw_sp,
28082808
enum mlxsw_sp_ipip_type ipipt,
28092809
struct mlxsw_sp_nexthop *nh,

0 commit comments

Comments
 (0)