@@ -4052,7 +4052,9 @@ parse_tc_actions(struct mlx5e_tc_act_parse_state *parse_state,
4052
4052
enum mlx5_flow_namespace_type ns_type ;
4053
4053
struct mlx5e_priv * priv = flow -> priv ;
4054
4054
struct flow_action_entry * act , * * _act ;
4055
+ struct mlx5_flow_attr * prev_attr ;
4055
4056
struct mlx5e_tc_act * tc_act ;
4057
+ bool is_missable ;
4056
4058
int err , i ;
4057
4059
4058
4060
flow_action_reorder .num_entries = flow_action -> num_entries ;
@@ -4069,6 +4071,9 @@ parse_tc_actions(struct mlx5e_tc_act_parse_state *parse_state,
4069
4071
flow_action_for_each (i , _act , & flow_action_reorder ) {
4070
4072
jump_state .jump_target = false;
4071
4073
act = * _act ;
4074
+ is_missable = false;
4075
+ prev_attr = attr ;
4076
+
4072
4077
tc_act = mlx5e_tc_act_get (act -> id , ns_type );
4073
4078
if (!tc_act ) {
4074
4079
NL_SET_ERR_MSG_MOD (extack , "Not implemented offload action" );
@@ -4092,14 +4097,14 @@ parse_tc_actions(struct mlx5e_tc_act_parse_state *parse_state,
4092
4097
goto out_free ;
4093
4098
4094
4099
parse_state -> actions |= attr -> action ;
4095
- if (!tc_act -> stats_action )
4096
- attr -> tc_act_cookies [attr -> tc_act_cookies_count ++ ] = act -> cookie ;
4097
4100
4098
4101
/* Split attr for multi table act if not the last act. */
4099
4102
if (jump_state .jump_target ||
4100
4103
(tc_act -> is_multi_table_act &&
4101
4104
tc_act -> is_multi_table_act (priv , act , attr ) &&
4102
4105
i < flow_action_reorder .num_entries - 1 )) {
4106
+ is_missable = tc_act -> is_missable ? tc_act -> is_missable (act ) : false;
4107
+
4103
4108
err = mlx5e_tc_act_post_parse (parse_state , flow_action , attr , ns_type );
4104
4109
if (err )
4105
4110
goto out_free ;
@@ -4112,6 +4117,16 @@ parse_tc_actions(struct mlx5e_tc_act_parse_state *parse_state,
4112
4117
4113
4118
list_add (& attr -> list , & flow -> attrs );
4114
4119
}
4120
+
4121
+ if (is_missable ) {
4122
+ /* Add counter to prev, and assign act to new (next) attr */
4123
+ prev_attr -> action |= MLX5_FLOW_CONTEXT_ACTION_COUNT ;
4124
+ flow_flag_set (flow , USE_ACT_STATS );
4125
+
4126
+ attr -> tc_act_cookies [attr -> tc_act_cookies_count ++ ] = act -> cookie ;
4127
+ } else if (!tc_act -> stats_action ) {
4128
+ prev_attr -> tc_act_cookies [prev_attr -> tc_act_cookies_count ++ ] = act -> cookie ;
4129
+ }
4115
4130
}
4116
4131
4117
4132
kfree (flow_action_reorder .entries );
0 commit comments