[v1] net/ice: support orignal VF action for DCF
diff mbox series

Message ID 20200606132356.35278-1-ting.xu@intel.com
State Superseded
Delegated to: xiaolong ye
Headers show
Series
  • [v1] net/ice: support orignal VF action for DCF
Related show

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/travis-robot success Travis build: passed
ci/iol-testing warning Testing issues
ci/iol-mellanox-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-nxp-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS

Commit Message

Ting Xu June 6, 2020, 1:23 p.m. UTC
From: Qi Zhang <qi.z.zhang@intel.com>

Add support to allow the original VF actions in DCF.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>

---
This patch depends on the previous patchset:
"enable DCF datapath configuration",
which starts with patch:
"net/ice: init RSS and supported RXDID in DCF"
---
 drivers/net/ice/ice_switch_filter.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

Patch
diff mbox series

diff --git a/drivers/net/ice/ice_switch_filter.c b/drivers/net/ice/ice_switch_filter.c
index dd3f4847a..993044f88 100644
--- a/drivers/net/ice/ice_switch_filter.c
+++ b/drivers/net/ice/ice_switch_filter.c
@@ -23,6 +23,7 @@ 
 #include "ice_logs.h"
 #include "ice_ethdev.h"
 #include "ice_generic_flow.h"
+#include "ice_dcf_ethdev.h"
 
 
 #define MAX_QGRP_NUM_TYPE 7
@@ -1240,7 +1241,8 @@  ice_switch_inset_get(const struct rte_flow_item pattern[],
 }
 
 static int
-ice_switch_parse_dcf_action(const struct rte_flow_action *actions,
+ice_switch_parse_dcf_action(struct ice_dcf_adapter *ad,
+			    const struct rte_flow_action *actions,
 			    struct rte_flow_error *error,
 			    struct ice_adv_rule_info *rule_info)
 {
@@ -1255,7 +1257,11 @@  ice_switch_parse_dcf_action(const struct rte_flow_action *actions,
 		case RTE_FLOW_ACTION_TYPE_VF:
 			rule_info->sw_act.fltr_act = ICE_FWD_TO_VSI;
 			act_vf = action->conf;
-			rule_info->sw_act.vsi_handle = act_vf->id;
+			if (act_vf->original)
+				rule_info->sw_act.vsi_handle =
+					ad->real_hw.avf.bus.func;
+			else
+				rule_info->sw_act.vsi_handle = act_vf->id;
 			break;
 		default:
 			rte_flow_error_set(error,
@@ -1515,7 +1521,8 @@  ice_switch_parse_pattern_action(struct ice_adapter *ad,
 	}
 
 	if (ad->hw.dcf_enabled)
-		ret = ice_switch_parse_dcf_action(actions, error, &rule_info);
+		ret = ice_switch_parse_dcf_action((void *)ad, actions, error,
+						  &rule_info);
 	else
 		ret = ice_switch_parse_action(pf, actions, error, &rule_info);