Skip to content

Commit

Permalink
mlxsw: spectrum_router: Pass nexthop netdev to mlxsw_sp_nexthop6_type…
Browse files Browse the repository at this point in the history
…_init()

Instead of passing the route and resolving the nexthop netdev from it,
pass the nexthop netdev directly.

This will later allow us to consolidate code paths between IPv4 and IPv6
code.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Ido Schimmel authored and Jakub Kicinski committed Nov 15, 2020
1 parent 7ba7bc5 commit 4dd38da
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
Original file line number Diff line number Diff line change
Expand Up @@ -5355,11 +5355,10 @@ static bool mlxsw_sp_nexthop6_ipip_type(const struct mlxsw_sp *mlxsw_sp,
static int mlxsw_sp_nexthop6_type_init(struct mlxsw_sp *mlxsw_sp,
struct mlxsw_sp_nexthop_group *nh_grp,
struct mlxsw_sp_nexthop *nh,
const struct fib6_info *rt)
const struct net_device *dev)
{
const struct mlxsw_sp_ipip_ops *ipip_ops;
struct mlxsw_sp_ipip_entry *ipip_entry;
struct net_device *dev = rt->fib6_nh->fib_nh_dev;
struct mlxsw_sp_rif *rif;
int err;

Expand Down Expand Up @@ -5417,7 +5416,7 @@ static int mlxsw_sp_nexthop6_init(struct mlxsw_sp *mlxsw_sp,
return 0;
nh->ifindex = dev->ifindex;

return mlxsw_sp_nexthop6_type_init(mlxsw_sp, nh_grp, nh, rt);
return mlxsw_sp_nexthop6_type_init(mlxsw_sp, nh_grp, nh, dev);
}

static void mlxsw_sp_nexthop6_fini(struct mlxsw_sp *mlxsw_sp,
Expand Down

0 comments on commit 4dd38da

Please sign in to comment.