]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net/mlx5e: Add flow_action to parse state
authorJianbo Liu <jianbol@nvidia.com>
Tue, 1 Mar 2022 09:02:19 +0000 (09:02 +0000)
committerSaeed Mahameed <saeedm@nvidia.com>
Sat, 2 Jul 2022 18:58:29 +0000 (11:58 -0700)
As a preparation for validating police action, adds flow_action to
parse state, which is to passed to parsing callbacks.

Signed-off-by: Jianbo Liu <jianbol@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/act.c
drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/act.h
drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/trap.c

index 2755c25ba324adfe726e4c5ab83718de964643b0..c66aff41374f7777cfbdf1e54d9a1d676a42aa81 100644 (file)
@@ -106,8 +106,8 @@ mlx5e_tc_act_init_parse_state(struct mlx5e_tc_act_parse_state *parse_state,
 {
        memset(parse_state, 0, sizeof(*parse_state));
        parse_state->flow = flow;
-       parse_state->num_actions = flow_action->num_entries;
        parse_state->extack = extack;
+       parse_state->flow_action = flow_action;
 }
 
 void
index f34714c5ddd4c1125c36edc3d4c8065aa19fdc53..f027beba70965212d839f12f8af0d6cc4ea6c395 100644 (file)
@@ -13,7 +13,7 @@
 struct mlx5_flow_attr;
 
 struct mlx5e_tc_act_parse_state {
-       unsigned int num_actions;
+       struct flow_action *flow_action;
        struct mlx5e_tc_flow *flow;
        struct netlink_ext_ack *extack;
        u32 actions;
index a7d9eab19e4a44abc7adf933082f3757bff29301..53b270f652b91bc6a5fa100dac6f279e698691ec 100644 (file)
@@ -12,7 +12,7 @@ tc_act_can_offload_trap(struct mlx5e_tc_act_parse_state *parse_state,
 {
        struct netlink_ext_ack *extack = parse_state->extack;
 
-       if (parse_state->num_actions != 1) {
+       if (parse_state->flow_action->num_entries != 1) {
                NL_SET_ERR_MSG_MOD(extack, "action trap is supported as a sole action only");
                return false;
        }