Skip to content

Commit 77d964e

Browse files
idoschdavem330
authored andcommitted
mlxsw: spectrum_router: Refresh offload indication upon group refresh
Now that we provide offload indication using the nexthop's flags we must refresh the offload indication whenever the offload state within the group changes. This didn't matter until now, as offload indication was provided using the FIB info flags and multipath routes were marked as offloaded as long as one of the nexthops was offloaded. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Tested-by: David Ahern <dsahern@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 1353ee7 commit 77d964e

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1652,6 +1652,24 @@ mlxsw_sp_nexthop_fib_entries_update(struct mlxsw_sp *mlxsw_sp,
16521652
return 0;
16531653
}
16541654

1655+
static void
1656+
mlxsw_sp_fib_entry_offload_refresh(struct mlxsw_sp_fib_entry *fib_entry,
1657+
enum mlxsw_reg_ralue_op op, int err);
1658+
1659+
static void
1660+
mlxsw_sp_nexthop_fib_entries_refresh(struct mlxsw_sp_nexthop_group *nh_grp)
1661+
{
1662+
enum mlxsw_reg_ralue_op op = MLXSW_REG_RALUE_OP_WRITE_WRITE;
1663+
struct mlxsw_sp_fib_entry *fib_entry;
1664+
1665+
list_for_each_entry(fib_entry, &nh_grp->fib_list, nexthop_group_node) {
1666+
if (!mlxsw_sp_fib_node_entry_is_first(fib_entry->fib_node,
1667+
fib_entry))
1668+
continue;
1669+
mlxsw_sp_fib_entry_offload_refresh(fib_entry, op, 0);
1670+
}
1671+
}
1672+
16551673
static void
16561674
mlxsw_sp_nexthop_group_refresh(struct mlxsw_sp *mlxsw_sp,
16571675
struct mlxsw_sp_nexthop_group *nh_grp)
@@ -1739,6 +1757,10 @@ mlxsw_sp_nexthop_group_refresh(struct mlxsw_sp *mlxsw_sp,
17391757
dev_warn(mlxsw_sp->bus_info->dev, "Failed to mass-update adjacency index for nexthop group.\n");
17401758
goto set_trap;
17411759
}
1760+
1761+
/* Offload state within the group changed, so update the flags. */
1762+
mlxsw_sp_nexthop_fib_entries_refresh(nh_grp);
1763+
17421764
return;
17431765

17441766
set_trap:

0 commit comments

Comments
 (0)