Skip to contentSkip to conversation

mlxsw: spectrum_router: Do not unconditionally clear route offload indication

PATCH In review Jiri Pirko 2 participants 2 messages Feb 16, 2018 – Feb 19, 2018

Subsystems (3)
lore
Share & tools
lore

Jiri Pirko

author
#0 lore raw

PATCH 1/1 mlxsw: spectrum_router: Do not unconditionally clear route offload indication

From: Ido Schimmel <[email protected]>

When mlxsw replaces (or deletes) a route it removes the offload indication from the replaced route. This is problematic for IPv4 routes, as the offload indication is stored in the fib_info which is usually shared between multiple routes.

Instead of unconditionally clearing the offload indication, only clear it if no other route is using the fib_info.

Fixes 3984d1a89fe7 ("mlxsw: spectrum_router: Provide offload indication using nexthop flags")

---
Dave, please, push to stable. Thanks!

---
 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +3 -0
index dcc6305f7c22..f7948e983637 100644
@@ -3794,6 +3794,9 @@ mlxsw_sp_fib4_entry_offload_unset(struct mlxsw_sp_fib_entry *fib_entry)
 	struct mlxsw_sp_nexthop_group *nh_grp = fib_entry->nh_group;
 	int i;
 
+	if (!list_is_singular(&nh_grp->fib_list))
+		return;
+
 	for (i = 0; i < nh_grp->count; i++) {
 		struct mlxsw_sp_nexthop *nh = &nh_grp->nexthops[i];
 
Signature · 1 line
2.14.3
maintainer
#1 lore raw

From: Jiri Pirko <[email protected]>
Date: Sat, 17 Feb 2018 00:30:44 +0100

Quoted 10 lines

From: Ido Schimmel <[email protected]>

When mlxsw replaces (or deletes) a route it removes the offload indication from the replaced route. This is problematic for IPv4 routes, as the offload indication is stored in the fib_info which is usually shared between multiple routes.

Instead of unconditionally clearing the offload indication, only clear it if no other route is using the fib_info.

Quoted 7 lines
Fixes 3984d1a89fe7 ("mlxsw: spectrum_router: Provide offload indication using nexthop flags")

---
Dave, please, push to stable. Thanks!

Applied and queued up for -stable, thanks Jiri!