]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net/mlx5e: TC, Clean redundant counter flag from tc action parsers
authorRoi Dayan <roid@nvidia.com>
Sun, 21 Nov 2021 09:38:53 +0000 (11:38 +0200)
committerSaeed Mahameed <saeedm@nvidia.com>
Thu, 17 Feb 2022 07:55:17 +0000 (23:55 -0800)
When tc actions being parsed only the last flow attr created needs the
counter flag and the previous flags being reset.
Clean the flag from the tc action parsers.

Signed-off-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/accept.c
drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/drop.c
drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/goto.c
drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/mirred.c
drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/mirred_nic.c
drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/redirect_ingress.c
drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/trap.c
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c

index 2b53738938a9afbe8b46669656d1aa9779a414d1..21aab96357b5bed1ee4497b237c2ab94e3acc047 100644 (file)
@@ -19,8 +19,7 @@ tc_act_parse_accept(struct mlx5e_tc_act_parse_state *parse_state,
                    struct mlx5e_priv *priv,
                    struct mlx5_flow_attr *attr)
 {
-       attr->action |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST |
-                       MLX5_FLOW_CONTEXT_ACTION_COUNT;
+       attr->action |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST;
        attr->flags |= MLX5_ATTR_FLAG_ACCEPT;
 
        return 0;
index 3d5f23636a02f0dffa3a41f7c5573efb4cd26ad3..dd025a95c439280f4c782b564ef4c38a5605e4fd 100644 (file)
@@ -19,8 +19,7 @@ tc_act_parse_drop(struct mlx5e_tc_act_parse_state *parse_state,
                  struct mlx5e_priv *priv,
                  struct mlx5_flow_attr *attr)
 {
-       attr->action |= MLX5_FLOW_CONTEXT_ACTION_DROP |
-                       MLX5_FLOW_CONTEXT_ACTION_COUNT;
+       attr->action |= MLX5_FLOW_CONTEXT_ACTION_DROP;
 
        return 0;
 }
index fb1be822ad25805e8ddf1fcb87792eabf888bac8..4726bcb46eecf148f6b8de1ebabb753f8f51f940 100644 (file)
@@ -76,8 +76,7 @@ tc_act_parse_goto(struct mlx5e_tc_act_parse_state *parse_state,
                  struct mlx5e_priv *priv,
                  struct mlx5_flow_attr *attr)
 {
-       attr->action |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST |
-                       MLX5_FLOW_CONTEXT_ACTION_COUNT;
+       attr->action |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST;
        attr->dest_chain = act->chain_index;
 
        return 0;
index 99fb98b3e71be0fbf720a659de92a96925403401..d08abec937045f918cc33862eb6e91b80f1f5893 100644 (file)
@@ -296,8 +296,7 @@ tc_act_parse_mirred(struct mlx5e_tc_act_parse_state *parse_state,
        if (err)
                return err;
 
-       attr->action |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST |
-                       MLX5_FLOW_CONTEXT_ACTION_COUNT;
+       attr->action |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST;
 
        return 0;
 }
index 16681cf6e93eb1679f4914104ac9795974c9a94f..90b4c1b34776b70b7676e87f3c0d928eb82481c0 100644 (file)
@@ -40,8 +40,7 @@ tc_act_parse_mirred_nic(struct mlx5e_tc_act_parse_state *parse_state,
 {
        attr->parse_attr->mirred_ifindex[0] = act->dev->ifindex;
        flow_flag_set(parse_state->flow, HAIRPIN);
-       attr->action |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST |
-                       MLX5_FLOW_CONTEXT_ACTION_COUNT;
+       attr->action |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST;
 
        return 0;
 }
index 9dd244147385e68fec4de31ce13894b15eb7b860..ad09a8a5f36e0441f53cc039c27da72c4091b0a5 100644 (file)
@@ -58,8 +58,7 @@ tc_act_parse_redirect_ingress(struct mlx5e_tc_act_parse_state *parse_state,
        struct net_device *out_dev = act->dev;
        int err;
 
-       attr->action |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST |
-                       MLX5_FLOW_CONTEXT_ACTION_COUNT;
+       attr->action |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST;
 
        err = mlx5e_set_fwd_to_int_port_actions(priv, attr, out_dev->ifindex,
                                                MLX5E_TC_INT_PORT_INGRESS,
index 9ea293fdc4348f76b0039d2e02d72e53fcc4b92d..a7d9eab19e4a44abc7adf933082f3757bff29301 100644 (file)
@@ -26,8 +26,7 @@ tc_act_parse_trap(struct mlx5e_tc_act_parse_state *parse_state,
                  struct mlx5e_priv *priv,
                  struct mlx5_flow_attr *attr)
 {
-       attr->action |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST |
-                       MLX5_FLOW_CONTEXT_ACTION_COUNT;
+       attr->action |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST;
        attr->flags |= MLX5_ATTR_FLAG_SLOW_PATH;
 
        return 0;
index b9d6a2e8b2400ca211ba1d074efc27e3c0c5ab18..76a015dfc5fce33c0f57afb6c1ab17db18d37795 100644 (file)
@@ -3536,7 +3536,6 @@ alloc_flow_post_acts(struct mlx5e_tc_flow *flow, struct netlink_ext_ack *extack)
                        /* Set counter action on last post act rule. */
                        attr->action |= MLX5_FLOW_CONTEXT_ACTION_COUNT;
                } else {
-                       attr->action &= ~MLX5_FLOW_CONTEXT_ACTION_COUNT;
                        err = mlx5e_tc_act_set_next_post_act(flow, attr, next_attr);
                        if (err)
                                goto out_free;