From: Chris Mi <cmi@nvidia.com>
Subject: [PATCH] BACKPORT:
 drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/act.c

Change-Id: Ibfbff98b93739dd1e467b78d0247fd74a5188a76
---
 .../net/ethernet/mellanox/mlx5/core/en/tc/act/act.c  | 12 ++++++++++++
 1 file changed, 12 insertions(+)

--- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/act.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/act.c
@@ -13,7 +13,9 @@ static struct mlx5e_tc_act *tc_acts_fdb[
 	[FLOW_ACTION_GOTO] = &mlx5e_tc_act_goto,
 	[FLOW_ACTION_REDIRECT] = &mlx5e_tc_act_mirred,
 	[FLOW_ACTION_MIRRED] = &mlx5e_tc_act_mirred,
+#ifdef HAVE_FLOW_ACTION_REDIRECT_INGRESS
 	[FLOW_ACTION_REDIRECT_INGRESS] = &mlx5e_tc_act_redirect_ingress,
+#endif
 	[FLOW_ACTION_VLAN_PUSH] = &mlx5e_tc_act_vlan,
 	[FLOW_ACTION_VLAN_POP] = &mlx5e_tc_act_vlan,
 	[FLOW_ACTION_VLAN_MANGLE] = &mlx5e_tc_act_vlan_mangle,
@@ -22,12 +24,18 @@ static struct mlx5e_tc_act *tc_acts_fdb[
 	[FLOW_ACTION_MANGLE] = &mlx5e_tc_act_pedit,
 	[FLOW_ACTION_ADD] = &mlx5e_tc_act_pedit,
 	[FLOW_ACTION_CSUM] = &mlx5e_tc_act_csum,
+#ifdef HAVE_FLOW_ACTION_PTYPE
 	[FLOW_ACTION_PTYPE] = &mlx5e_tc_act_ptype,
+#endif
 	[FLOW_ACTION_SAMPLE] = &mlx5e_tc_act_sample,
 	[FLOW_ACTION_POLICE] = &mlx5e_tc_act_police,
+#ifdef HAVE_FLOW_ACTION_CT
 	[FLOW_ACTION_CT] = &mlx5e_tc_act_ct,
+#endif
+#ifdef HAVE_FLOW_ACTION_MPLS
 	[FLOW_ACTION_MPLS_PUSH] = &mlx5e_tc_act_mpls_push,
 	[FLOW_ACTION_MPLS_POP] = &mlx5e_tc_act_mpls_pop,
+#endif
 };
 
 static struct mlx5e_tc_act *tc_acts_nic[NUM_FLOW_ACTIONS] = {
@@ -39,8 +47,12 @@ static struct mlx5e_tc_act *tc_acts_nic[
 	[FLOW_ACTION_ADD] = &mlx5e_tc_act_pedit,
 	[FLOW_ACTION_CSUM] = &mlx5e_tc_act_csum,
 	[FLOW_ACTION_MARK] = &mlx5e_tc_act_mark,
+#ifdef HAVE_FLOW_ACTION_PRIORITY
 	[FLOW_ACTION_PRIORITY] = &mlx5e_tc_act_prio,
+#endif
+#ifdef HAVE_FLOW_ACTION_CT
 	[FLOW_ACTION_CT] = &mlx5e_tc_act_ct,
+#endif
 };
 
 /**
