mlxsw: spectrum_router: Resolve RIF from nexthop struct instead of neighbour
authorIdo Schimmel <idosch@nvidia.com>
Mon, 23 Nov 2020 07:12:24 +0000 (09:12 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 24 Nov 2020 20:14:56 +0000 (12:14 -0800)
The two are the same, but for blackhole nexthops we will not have an
associated neighbour struct, so resolve the RIF from the nexthop struct
itself instead.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c

index 53d04e7..ef0e4e4 100644 (file)
@@ -3284,7 +3284,7 @@ static int __mlxsw_sp_nexthop_update(struct mlxsw_sp *mlxsw_sp, u32 adj_index,
 
        mlxsw_reg_ratr_pack(ratr_pl, MLXSW_REG_RATR_OP_WRITE_WRITE_ENTRY,
                            true, MLXSW_REG_RATR_TYPE_ETHERNET,
-                           adj_index, neigh_entry->rif);
+                           adj_index, nh->rif->rif_index);
        mlxsw_reg_ratr_eth_entry_pack(ratr_pl, neigh_entry->ha);
        if (nh->counter_valid)
                mlxsw_reg_ratr_counter_pack(ratr_pl, nh->counter_index, true);