aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@nvidia.com>2020-11-17 19:47:01 +0200
committerJakub Kicinski <kuba@kernel.org>2020-11-18 11:51:18 -0800
commit5b9954e1e7b839ac6a5a773cb498884dd4f947f1 (patch)
tree8048f2fd438e08a0d009e19e2a7192d009aa5072 /drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
parentmlxsw: spectrum_router: Set FIB entry's type based on nexthop group (diff)
downloadlinux-dev-5b9954e1e7b839ac6a5a773cb498884dd4f947f1.tar.xz
linux-dev-5b9954e1e7b839ac6a5a773cb498884dd4f947f1.zip
mlxsw: spectrum_router: Re-order mlxsw_sp_nexthop6_group_get()
Attach the FIB entry to the nexthop group after setting the offload flag on the IPv6 FIB info (i.e., 'struct fib6_info'). The second operation is not needed when the nexthop group is a nexthop object. This will allow us to have a common exit path from the function, regardless of the nexthop group's type. Signed-off-by: Ido Schimmel <idosch@nvidia.com> Reviewed-by: Jiri Pirko <jiri@nvidia.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to '')
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
index 4f5c135bc587..49cd6eba0661 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
@@ -5508,15 +5508,15 @@ static int mlxsw_sp_nexthop6_group_get(struct mlxsw_sp *mlxsw_sp,
return PTR_ERR(nh_grp);
}
- list_add_tail(&fib6_entry->common.nexthop_group_node,
- &nh_grp->fib_list);
- fib6_entry->common.nh_group = nh_grp;
-
/* The route and the nexthop are described by the same struct, so we
* need to the update the nexthop offload indication for the new route.
*/
__mlxsw_sp_nexthop6_group_offload_refresh(nh_grp, fib6_entry);
+ list_add_tail(&fib6_entry->common.nexthop_group_node,
+ &nh_grp->fib_list);
+ fib6_entry->common.nh_group = nh_grp;
+
return 0;
}