提交 3cc78411 编写于 作者: R Roi Dayan 提交者: Saeed Mahameed

net/mlx5e: Remove redundant actions arg from validate_goto_chain()

Passing actions is redundant and can be retrieved from flow.
Signed-off-by: NRoi Dayan <roid@nvidia.com>
Reviewed-by: NOz Shlomo <ozsh@nvidia.com>
Reviewed-by: NMaor Dickman <maord@nvidia.com>
Signed-off-by: NSaeed Mahameed <saeedm@nvidia.com>
上级 9745dbe0
...@@ -3359,11 +3359,9 @@ add_vlan_prio_tag_rewrite_action(struct mlx5e_priv *priv, ...@@ -3359,11 +3359,9 @@ add_vlan_prio_tag_rewrite_action(struct mlx5e_priv *priv,
static int validate_goto_chain(struct mlx5e_priv *priv, static int validate_goto_chain(struct mlx5e_priv *priv,
struct mlx5e_tc_flow *flow, struct mlx5e_tc_flow *flow,
const struct flow_action_entry *act, const struct flow_action_entry *act,
u32 actions,
struct netlink_ext_ack *extack) struct netlink_ext_ack *extack)
{ {
bool is_esw = mlx5e_is_eswitch_flow(flow); bool is_esw = mlx5e_is_eswitch_flow(flow);
struct mlx5_flow_attr *attr = flow->attr;
bool ft_flow = mlx5e_is_ft_flow(flow); bool ft_flow = mlx5e_is_ft_flow(flow);
u32 dest_chain = act->chain_index; u32 dest_chain = act->chain_index;
struct mlx5_fs_chains *chains; struct mlx5_fs_chains *chains;
...@@ -3384,7 +3382,7 @@ static int validate_goto_chain(struct mlx5e_priv *priv, ...@@ -3384,7 +3382,7 @@ static int validate_goto_chain(struct mlx5e_priv *priv,
} }
if (!mlx5_chains_backwards_supported(chains) && if (!mlx5_chains_backwards_supported(chains) &&
dest_chain <= attr->chain) { dest_chain <= flow->attr->chain) {
NL_SET_ERR_MSG_MOD(extack, NL_SET_ERR_MSG_MOD(extack,
"Goto lower numbered chain isn't supported"); "Goto lower numbered chain isn't supported");
return -EOPNOTSUPP; return -EOPNOTSUPP;
...@@ -3396,8 +3394,8 @@ static int validate_goto_chain(struct mlx5e_priv *priv, ...@@ -3396,8 +3394,8 @@ static int validate_goto_chain(struct mlx5e_priv *priv,
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
if (actions & (MLX5_FLOW_CONTEXT_ACTION_PACKET_REFORMAT | if (flow->attr->action & (MLX5_FLOW_CONTEXT_ACTION_PACKET_REFORMAT |
MLX5_FLOW_CONTEXT_ACTION_DECAP) && MLX5_FLOW_CONTEXT_ACTION_DECAP) &&
!reformat_and_fwd) { !reformat_and_fwd) {
NL_SET_ERR_MSG_MOD(extack, NL_SET_ERR_MSG_MOD(extack,
"Goto chain is not allowed if action has reformat or decap"); "Goto chain is not allowed if action has reformat or decap");
...@@ -3541,8 +3539,7 @@ parse_tc_nic_actions(struct mlx5e_priv *priv, ...@@ -3541,8 +3539,7 @@ parse_tc_nic_actions(struct mlx5e_priv *priv,
} }
break; break;
case FLOW_ACTION_GOTO: case FLOW_ACTION_GOTO:
err = validate_goto_chain(priv, flow, act, attr->action, err = validate_goto_chain(priv, flow, act, extack);
extack);
if (err) if (err)
return err; return err;
...@@ -4206,8 +4203,7 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv, ...@@ -4206,8 +4203,7 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv,
decap = true; decap = true;
break; break;
case FLOW_ACTION_GOTO: case FLOW_ACTION_GOTO:
err = validate_goto_chain(priv, flow, act, attr->action, err = validate_goto_chain(priv, flow, act, extack);
extack);
if (err) if (err)
return err; return err;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册