mlxsw: spectrum_router: Use loopback RIF for unresolved nexthops
Now that the driver creates a loopback RIF during its initialization, it can be used to program the adjacency entries for unresolved nexthops instead of other RIFs. The loopback RIF is guaranteed to exist for the entire life time of the driver, unlike other RIFs that come and go. Signed-off-by: Ido Schimmel <idosch@nvidia.com> Reviewed-by: Jiri Pirko <jiri@nvidia.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
52d45575ec
commit
919f6aaa3a
|
@ -4994,7 +4994,7 @@ int mlxsw_sp_fib_entry_commit(struct mlxsw_sp *mlxsw_sp,
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mlxsw_sp_adj_discard_write(struct mlxsw_sp *mlxsw_sp, u16 rif_index)
|
static int mlxsw_sp_adj_discard_write(struct mlxsw_sp *mlxsw_sp)
|
||||||
{
|
{
|
||||||
enum mlxsw_reg_ratr_trap_action trap_action;
|
enum mlxsw_reg_ratr_trap_action trap_action;
|
||||||
char ratr_pl[MLXSW_REG_RATR_LEN];
|
char ratr_pl[MLXSW_REG_RATR_LEN];
|
||||||
|
@ -5011,7 +5011,8 @@ static int mlxsw_sp_adj_discard_write(struct mlxsw_sp *mlxsw_sp, u16 rif_index)
|
||||||
trap_action = MLXSW_REG_RATR_TRAP_ACTION_TRAP;
|
trap_action = MLXSW_REG_RATR_TRAP_ACTION_TRAP;
|
||||||
mlxsw_reg_ratr_pack(ratr_pl, MLXSW_REG_RATR_OP_WRITE_WRITE_ENTRY, true,
|
mlxsw_reg_ratr_pack(ratr_pl, MLXSW_REG_RATR_OP_WRITE_WRITE_ENTRY, true,
|
||||||
MLXSW_REG_RATR_TYPE_ETHERNET,
|
MLXSW_REG_RATR_TYPE_ETHERNET,
|
||||||
mlxsw_sp->router->adj_discard_index, rif_index);
|
mlxsw_sp->router->adj_discard_index,
|
||||||
|
mlxsw_sp->router->lb_rif_index);
|
||||||
mlxsw_reg_ratr_trap_action_set(ratr_pl, trap_action);
|
mlxsw_reg_ratr_trap_action_set(ratr_pl, trap_action);
|
||||||
mlxsw_reg_ratr_trap_id_set(ratr_pl, MLXSW_TRAP_ID_RTR_EGRESS0);
|
mlxsw_reg_ratr_trap_id_set(ratr_pl, MLXSW_TRAP_ID_RTR_EGRESS0);
|
||||||
err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ratr), ratr_pl);
|
err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ratr), ratr_pl);
|
||||||
|
@ -5051,8 +5052,7 @@ static int mlxsw_sp_fib_entry_op_remote(struct mlxsw_sp *mlxsw_sp,
|
||||||
adjacency_index = nhgi->adj_index;
|
adjacency_index = nhgi->adj_index;
|
||||||
ecmp_size = nhgi->ecmp_size;
|
ecmp_size = nhgi->ecmp_size;
|
||||||
} else if (!nhgi->adj_index_valid && nhgi->count && nhgi->nh_rif) {
|
} else if (!nhgi->adj_index_valid && nhgi->count && nhgi->nh_rif) {
|
||||||
err = mlxsw_sp_adj_discard_write(mlxsw_sp,
|
err = mlxsw_sp_adj_discard_write(mlxsw_sp);
|
||||||
nhgi->nh_rif->rif_index);
|
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
trap_action = MLXSW_REG_RALUE_TRAP_ACTION_NOP;
|
trap_action = MLXSW_REG_RALUE_TRAP_ACTION_NOP;
|
||||||
|
|
Loading…
Reference in New Issue