From patchwork Sat Jun 6 13:23:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xu, Ting" X-Patchwork-Id: 70916 X-Patchwork-Delegate: xiaolong.ye@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4D27FA0350; Sat, 6 Jun 2020 07:24:52 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7E0151D424; Sat, 6 Jun 2020 07:24:51 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id F0F2F1D421 for ; Sat, 6 Jun 2020 07:24:49 +0200 (CEST) IronPort-SDR: DjzKLdVjqRE2qD8H/pA8qY+dU02DBB+MpW5Mh/agMlXKritr4xNuzK/BzrPmVONuKP06K+8eWf 8HWnl++70MmA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jun 2020 22:24:49 -0700 IronPort-SDR: eqNKWPq5ZJY24etmNexXK1RVK2kmYXWIwpWGDkUJlFhVOlmyUr24ONcftHYgxZ/pGCOycIn7EC +wpeRQtTuGwA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,479,1583222400"; d="scan'208";a="294908488" Received: from dpdk-xuting-main.sh.intel.com ([10.67.117.84]) by fmsmga004.fm.intel.com with ESMTP; 05 Jun 2020 22:24:47 -0700 From: Ting Xu To: dev@dpdk.org Cc: qi.z.zhang@intel.com, qiming.yang@intel.com Date: Sat, 6 Jun 2020 13:23:56 +0000 Message-Id: <20200606132356.35278-1-ting.xu@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH v1] net/ice: support orignal VF action for DCF X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Qi Zhang Add support to allow the original VF actions in DCF. Signed-off-by: Qi Zhang --- 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(-) 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);