Commit dcbda282 authored by Petr Machata's avatar Petr Machata Committed by David S. Miller

mlxsw: spectrum_router: Configure TIGCR on init

Spectrum tunnels do not default to ttl of "inherit" like the Linux ones
do. Configure TIGCR on router init so that the TTL of tunnel packets is
copied from the overlay packets.

Fixes: ee954d1a ("mlxsw: spectrum_router: Support GRE tunnels")
Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
Reviewed-by: default avatarIdo Schimmel <idosch@mellanox.com>
Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 14aefd90
...@@ -5896,11 +5896,20 @@ static void mlxsw_sp_rifs_fini(struct mlxsw_sp *mlxsw_sp) ...@@ -5896,11 +5896,20 @@ static void mlxsw_sp_rifs_fini(struct mlxsw_sp *mlxsw_sp)
kfree(mlxsw_sp->router->rifs); kfree(mlxsw_sp->router->rifs);
} }
static int
mlxsw_sp_ipip_config_tigcr(struct mlxsw_sp *mlxsw_sp)
{
char tigcr_pl[MLXSW_REG_TIGCR_LEN];
mlxsw_reg_tigcr_pack(tigcr_pl, true, 0);
return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(tigcr), tigcr_pl);
}
static int mlxsw_sp_ipips_init(struct mlxsw_sp *mlxsw_sp) static int mlxsw_sp_ipips_init(struct mlxsw_sp *mlxsw_sp)
{ {
mlxsw_sp->router->ipip_ops_arr = mlxsw_sp_ipip_ops_arr; mlxsw_sp->router->ipip_ops_arr = mlxsw_sp_ipip_ops_arr;
INIT_LIST_HEAD(&mlxsw_sp->router->ipip_list); INIT_LIST_HEAD(&mlxsw_sp->router->ipip_list);
return 0; return mlxsw_sp_ipip_config_tigcr(mlxsw_sp);
} }
static void mlxsw_sp_ipips_fini(struct mlxsw_sp *mlxsw_sp) static void mlxsw_sp_ipips_fini(struct mlxsw_sp *mlxsw_sp)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment