Skip to content

Commit 68c3cd9

Browse files
pmachatadavem330
authored andcommitted
mlxsw: spectrum_router: Handle MTU change of GRE netdevs
Update MTU of overlay loopback in accordance with the setting on the tunnel netdevice. Fixes: 0063587 ("mlxsw: spectrum: Support decap-only IP-in-IP tunnels") Signed-off-by: Petr Machata <[email protected]> Signed-off-by: Ido Schimmel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 22b9905 commit 68c3cd9

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,6 +1407,28 @@ mlxsw_sp_rif_ipip_lb_op(struct mlxsw_sp_rif_ipip_lb *lb_rif,
14071407
return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ritr), ritr_pl);
14081408
}
14091409

1410+
static int mlxsw_sp_netdevice_ipip_ol_update_mtu(struct mlxsw_sp *mlxsw_sp,
1411+
struct net_device *ol_dev)
1412+
{
1413+
struct mlxsw_sp_ipip_entry *ipip_entry;
1414+
struct mlxsw_sp_rif_ipip_lb *lb_rif;
1415+
struct mlxsw_sp_vr *ul_vr;
1416+
int err = 0;
1417+
1418+
ipip_entry = mlxsw_sp_ipip_entry_find_by_ol_dev(mlxsw_sp, ol_dev);
1419+
if (ipip_entry) {
1420+
lb_rif = ipip_entry->ol_lb;
1421+
ul_vr = &mlxsw_sp->router->vrs[lb_rif->ul_vr_id];
1422+
err = mlxsw_sp_rif_ipip_lb_op(lb_rif, ul_vr, true);
1423+
if (err)
1424+
goto out;
1425+
lb_rif->common.mtu = ol_dev->mtu;
1426+
}
1427+
1428+
out:
1429+
return err;
1430+
}
1431+
14101432
static void mlxsw_sp_netdevice_ipip_ol_up_event(struct mlxsw_sp *mlxsw_sp,
14111433
struct net_device *ol_dev)
14121434
{
@@ -1687,6 +1709,8 @@ int mlxsw_sp_netdevice_ipip_ol_event(struct mlxsw_sp *mlxsw_sp,
16871709
extack = info->extack;
16881710
return mlxsw_sp_netdevice_ipip_ol_change_event(mlxsw_sp,
16891711
ol_dev, extack);
1712+
case NETDEV_CHANGEMTU:
1713+
return mlxsw_sp_netdevice_ipip_ol_update_mtu(mlxsw_sp, ol_dev);
16901714
}
16911715
return 0;
16921716
}

0 commit comments

Comments
 (0)