Blob Blame History Raw
From: Roi Dayan <roid@nvidia.com>
Date: Tue, 3 Aug 2021 14:50:42 +0300
Subject: net/mlx5e: Remove redundant actions arg from validate_goto_chain()
Patch-mainline: v5.17-rc1
Git-commit: 3cc78411f3f4158fee710a7c606bf65a3f8ebb67
References: jsc#PED-1549

Passing actions is redundant and can be retrieved from flow.

Signed-off-by: Roi Dayan <roid@nvidia.com>
Reviewed-by: Oz Shlomo <ozsh@nvidia.com>
Reviewed-by: Maor Dickman <maord@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Acked-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_tc.c |   14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -3356,11 +3356,9 @@ add_vlan_prio_tag_rewrite_action(struct
 static int validate_goto_chain(struct mlx5e_priv *priv,
 			       struct mlx5e_tc_flow *flow,
 			       const struct flow_action_entry *act,
-			       u32 actions,
 			       struct netlink_ext_ack *extack)
 {
 	bool is_esw = mlx5e_is_eswitch_flow(flow);
-	struct mlx5_flow_attr *attr = flow->attr;
 	bool ft_flow = mlx5e_is_ft_flow(flow);
 	u32 dest_chain = act->chain_index;
 	struct mlx5_fs_chains *chains;
@@ -3381,7 +3379,7 @@ static int validate_goto_chain(struct ml
 	}
 
 	if (!mlx5_chains_backwards_supported(chains) &&
-	    dest_chain <= attr->chain) {
+	    dest_chain <= flow->attr->chain) {
 		NL_SET_ERR_MSG_MOD(extack,
 				   "Goto lower numbered chain isn't supported");
 		return -EOPNOTSUPP;
@@ -3393,8 +3391,8 @@ static int validate_goto_chain(struct ml
 		return -EOPNOTSUPP;
 	}
 
-	if (actions & (MLX5_FLOW_CONTEXT_ACTION_PACKET_REFORMAT |
-		       MLX5_FLOW_CONTEXT_ACTION_DECAP) &&
+	if (flow->attr->action & (MLX5_FLOW_CONTEXT_ACTION_PACKET_REFORMAT |
+				  MLX5_FLOW_CONTEXT_ACTION_DECAP) &&
 	    !reformat_and_fwd) {
 		NL_SET_ERR_MSG_MOD(extack,
 				   "Goto chain is not allowed if action has reformat or decap");
@@ -3538,8 +3536,7 @@ parse_tc_nic_actions(struct mlx5e_priv *
 			}
 			break;
 		case FLOW_ACTION_GOTO:
-			err = validate_goto_chain(priv, flow, act, attr->action,
-						  extack);
+			err = validate_goto_chain(priv, flow, act, extack);
 			if (err)
 				return err;
 
@@ -4203,8 +4200,7 @@ static int parse_tc_fdb_actions(struct m
 			decap = true;
 			break;
 		case FLOW_ACTION_GOTO:
-			err = validate_goto_chain(priv, flow, act, attr->action,
-						  extack);
+			err = validate_goto_chain(priv, flow, act, extack);
 			if (err)
 				return err;