1 // SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB
2 // Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
5 #include "en/tc_priv.h"
9 tc_act_parse_ct(struct mlx5e_tc_act_parse_state *parse_state,
10 const struct flow_action_entry *act,
11 struct mlx5e_priv *priv,
12 struct mlx5_flow_attr *attr)
16 err = mlx5_tc_ct_parse_action(parse_state->ct_priv, attr, act, parse_state->extack);
20 if (mlx5e_is_eswitch_flow(parse_state->flow))
21 attr->esw_attr->split_count = attr->esw_attr->out_count;
23 attr->flags |= MLX5_ATTR_FLAG_CT;
29 tc_act_post_parse_ct(struct mlx5e_tc_act_parse_state *parse_state,
30 struct mlx5e_priv *priv,
31 struct mlx5_flow_attr *attr)
33 if (!(attr->flags & MLX5_ATTR_FLAG_CT))
36 return mlx5_tc_ct_flow_offload(parse_state->ct_priv, attr);
40 tc_act_is_multi_table_act_ct(struct mlx5e_priv *priv,
41 const struct flow_action_entry *act,
42 struct mlx5_flow_attr *attr)
44 if (act->ct.action & TCA_CT_ACT_CLEAR)
51 tc_act_is_missable_ct(const struct flow_action_entry *act)
53 return !(act->ct.action & TCA_CT_ACT_CLEAR);
56 struct mlx5e_tc_act mlx5e_tc_act_ct = {
57 .parse_action = tc_act_parse_ct,
58 .post_parse = tc_act_post_parse_ct,
59 .is_multi_table_act = tc_act_is_multi_table_act_ct,
60 .is_missable = tc_act_is_missable_ct,