mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-02-06 01:05:16 +07:00
mlxsw: spectrum_router: Pass argument explicitly
Instead of relying on the LPM tree to be assigned to the virtual router before binding the two, lets pass it explicitly. This will later allow us to return upon binding error instead of having to perform a rollback of the assignment. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
cc70267008
commit
0adb214ba2
@ -659,13 +659,13 @@ static struct mlxsw_sp_vr *mlxsw_sp_vr_find_unused(struct mlxsw_sp *mlxsw_sp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int mlxsw_sp_vr_lpm_tree_bind(struct mlxsw_sp *mlxsw_sp,
|
static int mlxsw_sp_vr_lpm_tree_bind(struct mlxsw_sp *mlxsw_sp,
|
||||||
const struct mlxsw_sp_fib *fib)
|
const struct mlxsw_sp_fib *fib, u8 tree_id)
|
||||||
{
|
{
|
||||||
char raltb_pl[MLXSW_REG_RALTB_LEN];
|
char raltb_pl[MLXSW_REG_RALTB_LEN];
|
||||||
|
|
||||||
mlxsw_reg_raltb_pack(raltb_pl, fib->vr->id,
|
mlxsw_reg_raltb_pack(raltb_pl, fib->vr->id,
|
||||||
(enum mlxsw_reg_ralxx_protocol) fib->proto,
|
(enum mlxsw_reg_ralxx_protocol) fib->proto,
|
||||||
fib->lpm_tree->id);
|
tree_id);
|
||||||
return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(raltb), raltb_pl);
|
return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(raltb), raltb_pl);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -777,7 +777,7 @@ mlxsw_sp_vr_lpm_tree_check(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_fib *fib,
|
|||||||
|
|
||||||
/* Prevent packet loss by overwriting existing binding */
|
/* Prevent packet loss by overwriting existing binding */
|
||||||
fib->lpm_tree = new_tree;
|
fib->lpm_tree = new_tree;
|
||||||
err = mlxsw_sp_vr_lpm_tree_bind(mlxsw_sp, fib);
|
err = mlxsw_sp_vr_lpm_tree_bind(mlxsw_sp, fib, new_tree->id);
|
||||||
if (err)
|
if (err)
|
||||||
goto err_tree_bind;
|
goto err_tree_bind;
|
||||||
mlxsw_sp_lpm_tree_put(mlxsw_sp, lpm_tree);
|
mlxsw_sp_lpm_tree_put(mlxsw_sp, lpm_tree);
|
||||||
@ -2631,7 +2631,7 @@ static int mlxsw_sp_fib_node_init(struct mlxsw_sp *mlxsw_sp,
|
|||||||
if (IS_ERR(lpm_tree))
|
if (IS_ERR(lpm_tree))
|
||||||
return PTR_ERR(lpm_tree);
|
return PTR_ERR(lpm_tree);
|
||||||
fib->lpm_tree = lpm_tree;
|
fib->lpm_tree = lpm_tree;
|
||||||
err = mlxsw_sp_vr_lpm_tree_bind(mlxsw_sp, fib);
|
err = mlxsw_sp_vr_lpm_tree_bind(mlxsw_sp, fib, lpm_tree->id);
|
||||||
if (err)
|
if (err)
|
||||||
goto err_tree_bind;
|
goto err_tree_bind;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user