From: Valentine Fatiev <valentinef@nvidia.com>
Subject: [PATCH] BACKPORT:
 drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/vlan.c

Change-Id: Ib87ab1d1a5bc5fc138c95e98e57e23be0cd104bf
---
 drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/vlan.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

--- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/vlan.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/vlan.c
@@ -68,6 +68,7 @@ parse_tc_vlan_action(struct mlx5e_priv *
 		else
 			*action |= MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH;
 		break;
+#ifdef HAVE_FLOW_ACTION_VLAN_PUSH_ETH
 	case FLOW_ACTION_VLAN_POP_ETH:
 		parse_state->eth_pop = true;
 		break;
@@ -78,6 +79,7 @@ parse_tc_vlan_action(struct mlx5e_priv *
 		memcpy(attr->eth.h_dest, act->vlan_push_eth.dst, ETH_ALEN);
 		memcpy(attr->eth.h_source, act->vlan_push_eth.src, ETH_ALEN);
 		break;
+#endif
 	default:
 		NL_SET_ERR_MSG_MOD(extack, "Unexpected action id for VLAN");
 		return -EINVAL;
@@ -127,10 +129,12 @@ mlx5e_tc_act_vlan_add_pop_action(struct
 	struct flow_action_entry vlan_act = {
 		.id = FLOW_ACTION_VLAN_POP,
 	};
-	int nest_level, err = 0;
+	int nest_level = 1, err = 0;
 
+#ifdef HAVE_NET_DEVICE_LOWER_LEVEL
 	nest_level = attr->parse_attr->filter_dev->lower_level -
 						priv->netdev->lower_level;
+#endif
 	while (nest_level--) {
 		err = parse_tc_vlan_action(priv, &vlan_act, attr->esw_attr, &attr->action,
 					   extack, NULL);
