Patch "mlxsw: spectrum_router: Correctly reallocate adjacency entries" has been added to the 4.9-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
mlxsw: spectrum_router: Correctly reallocate adjacency entries
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
mlxsw-spectrum_router-correctly-reallocate-adjacency-entries.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From foo@baz Mon Jul 3 13:22:04 CEST 2017
From: Ido Schimmel <[email protected]>
Date: Mon, 23 Jan 2017 11:11:42 +0100
Subject: mlxsw: spectrum_router: Correctly reallocate adjacency entries
From: Ido Schimmel <[email protected]>
[ Upstream commit a59b7e0246774e28193126fe7fdbbd0ae9c67dcc ]
mlxsw_sp_nexthop_group_mac_update() is called in one of two cases:
1) When the MAC of a nexthop needs to be updated
2) When the size of a nexthop group has changed
In the second case the adjacency entries for the nexthop group need to be reallocated from the adjacency table. In this case we must write to the entries the MAC addresses of all the nexthops that should be offloaded and not only those whose MAC changed. Otherwise, these entries would be filled with garbage data, resulting in packet loss.
--- drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +6 -4
@@ -1178,7 +1178,8 @@ static int mlxsw_sp_nexthop_mac_update(sstatic int mlxsw_sp_nexthop_group_mac_update (struct mlxsw_sp *mlxsw_sp, -struct mlxsw_sp_nexthop_group *nh_grp) +struct mlxsw_sp_nexthop_group *nh_grp, +bool reallocate) {u32 adj_index = nh_grp->adj_index;/* base */ struct mlxsw_sp_nexthop *nh;
@@ -1193,7 +1194,7 @@ mlxsw_sp_nexthop_group_mac_update(structcontinue ; } -if (nh->update) { +if (nh->update || reallocate) { err =mlxsw_sp_nexthop_mac_update (mlxsw_sp, adj_index, nh);if (err)
@@ -1254,7 +1255,8 @@ mlxsw_sp_nexthop_group_refresh(struct ml/* Nothing was added or removed, so no need to reallocate. Just * update MAC on existing adjacency indexes. */ - err =mlxsw_sp_nexthop_group_mac_update (mlxsw_sp, nh_grp); + err =mlxsw_sp_nexthop_group_mac_update (mlxsw_sp, nh_grp, + false);if (err) {dev_warn (mlxsw_sp->bus_info->dev,"Failed to update neigh MAC in adjacency table.\n" ); goto set_trap;
@@ -1282,7 +1284,7 @@ mlxsw_sp_nexthop_group_refresh(struct ml nh_grp->adj_index_valid =1 ; nh_grp->adj_index = adj_index; nh_grp->ecmp_size = ecmp_size; - err =mlxsw_sp_nexthop_group_mac_update (mlxsw_sp, nh_grp); + err =mlxsw_sp_nexthop_group_mac_update (mlxsw_sp, nh_grp, true);if (err) {dev_warn (mlxsw_sp->bus_info->dev,"Failed to update neigh MAC in adjacency table.\n" ); goto set_trap;
Patches currently in stable-queue which might be from [email protected] are
queue-4.9/mlxsw-spectrum_router-correctly-reallocate-adjacency-entries.patch