Commit 7f8770c7 authored by Roi Dayan's avatar Roi Dayan Committed by Saeed Mahameed
Browse files

net/mlx5e: Set action fwd flag when parsing tc action goto



Do it when parsing like in other actions instead of when
checking if goto is supported in current scenario.

Signed-off-by: default avatarRoi Dayan <roid@nvidia.com>
Reviewed-by: default avatarMaor Dickman <maord@nvidia.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
parent 475fb86a
Loading
Loading
Loading
Loading
+18 −25
Original line number Diff line number Diff line
@@ -3450,7 +3450,8 @@ static int parse_tc_nic_actions(struct mlx5e_priv *priv,
			if (err)
				return err;

			action |= MLX5_FLOW_CONTEXT_ACTION_COUNT;
			action |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST |
				  MLX5_FLOW_CONTEXT_ACTION_COUNT;
			attr->dest_chain = act->chain_index;
			break;
		case FLOW_ACTION_CT:
@@ -3483,13 +3484,10 @@ static int parse_tc_nic_actions(struct mlx5e_priv *priv,

	attr->action = action;

	if (attr->dest_chain) {
		if (attr->action & MLX5_FLOW_CONTEXT_ACTION_FWD_DEST) {
	if (attr->dest_chain && parse_attr->mirred_ifindex[0]) {
		NL_SET_ERR_MSG(extack, "Mirroring goto chain rules isn't supported");
		return -EOPNOTSUPP;
	}
		attr->action |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST;
	}

	if (!actions_match_supported(priv, flow_action, parse_attr, flow, extack))
		return -EOPNOTSUPP;
@@ -3994,7 +3992,8 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv,
			if (err)
				return err;

			action |= MLX5_FLOW_CONTEXT_ACTION_COUNT;
			action |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST |
				  MLX5_FLOW_CONTEXT_ACTION_COUNT;
			attr->dest_chain = act->chain_index;
			break;
		case FLOW_ACTION_CT:
@@ -4064,8 +4063,7 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv,
	if (!actions_match_supported(priv, flow_action, parse_attr, flow, extack))
		return -EOPNOTSUPP;

	if (attr->dest_chain) {
		if (decap) {
	if (attr->dest_chain && decap) {
		/* It can be supported if we'll create a mapping for
		 * the tunnel device only (without tunnel), and set
		 * this tunnel id with this decap flow.
@@ -4074,16 +4072,11 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv,
		 * device.
		 */

			NL_SET_ERR_MSG(extack,
				       "Decap with goto isn't supported");
			netdev_warn(priv->netdev,
				    "Decap with goto isn't supported");
		NL_SET_ERR_MSG(extack, "Decap with goto isn't supported");
		netdev_warn(priv->netdev, "Decap with goto isn't supported");
		return -EOPNOTSUPP;
	}

		attr->action |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST;
	}

	if (!(attr->action &
	      (MLX5_FLOW_CONTEXT_ACTION_FWD_DEST | MLX5_FLOW_CONTEXT_ACTION_DROP))) {
		NL_SET_ERR_MSG_MOD(extack,