[PATCH net-next mlxsw 1/2] mlxsw: core_acl_flex_actions: Avoid WARN_ON for conflicting actions

Nir Dotan nird at mellanox.com
Wed Jul 25 18:37:43 AEST 2018


Stop the driver from marking actions which terminate a packet flow
such as trap, discard and pass in order not to accept a following
terminating action. This was found out to be unnecessary as SW
model allows setting several terminating actions so that some
of the actions configured will never be executed.
Furthermore, this kind of configuration generated a warning as the
driver was using the same marking for end of action block, so it
would not expect to see it before the end of an action block.

Signed-off-by: Nir Dotan <nird at mellanox.com>
---
 drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.c | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.c b/drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.c
index a4669e7..9c87363 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.c
@@ -458,33 +458,24 @@ EXPORT_SYMBOL(mlxsw_afa_block_activity_get);
 
 int mlxsw_afa_block_continue(struct mlxsw_afa_block *block)
 {
-	if (block->finished)
-		return -EINVAL;
 	mlxsw_afa_set_goto_set(block->cur_set,
 			       MLXSW_AFA_SET_GOTO_BINDING_CMD_NONE, 0);
-	block->finished = true;
 	return 0;
 }
 EXPORT_SYMBOL(mlxsw_afa_block_continue);
 
 int mlxsw_afa_block_jump(struct mlxsw_afa_block *block, u16 group_id)
 {
-	if (block->finished)
-		return -EINVAL;
 	mlxsw_afa_set_goto_set(block->cur_set,
 			       MLXSW_AFA_SET_GOTO_BINDING_CMD_JUMP, group_id);
-	block->finished = true;
 	return 0;
 }
 EXPORT_SYMBOL(mlxsw_afa_block_jump);
 
 int mlxsw_afa_block_terminate(struct mlxsw_afa_block *block)
 {
-	if (block->finished)
-		return -EINVAL;
 	mlxsw_afa_set_goto_set(block->cur_set,
 			       MLXSW_AFA_SET_GOTO_BINDING_CMD_TERM, 0);
-	block->finished = true;
 	return 0;
 }
 EXPORT_SYMBOL(mlxsw_afa_block_terminate);
-- 
2.8.4



More information about the Linux-mlxsw mailing list