mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
mlxsw: spectrum_acl: Add cleanup after C-TCAM update error condition
[ Upstream commitff0db43cd6] When writing to C-TCAM, mlxsw driver uses cregion->ops->entry_insert(). In case of C-TCAM HW insertion error, the opposite action should take place. Add error handling case in which the C-TCAM region entry is removed, by calling cregion->ops->entry_remove(). Fixes:a0a777b940("mlxsw: spectrum_acl: Start using A-TCAM") Signed-off-by: Nir Dotan <nird@mellanox.com> Reviewed-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
7169938b07
commit
0c596ab039
@@ -75,7 +75,15 @@ mlxsw_sp_acl_ctcam_region_entry_insert(struct mlxsw_sp *mlxsw_sp,
|
||||
act_set = mlxsw_afa_block_first_set(rulei->act_block);
|
||||
mlxsw_reg_ptce2_flex_action_set_memcpy_to(ptce2_pl, act_set);
|
||||
|
||||
return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ptce2), ptce2_pl);
|
||||
err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ptce2), ptce2_pl);
|
||||
if (err)
|
||||
goto err_ptce2_write;
|
||||
|
||||
return 0;
|
||||
|
||||
err_ptce2_write:
|
||||
cregion->ops->entry_remove(cregion, centry);
|
||||
return err;
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user