From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AF80FA0547; Fri, 10 Sep 2021 10:27:09 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F260341120; Fri, 10 Sep 2021 10:26:59 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 760A74003E for ; Fri, 10 Sep 2021 10:26:54 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10102"; a="208136146" X-IronPort-AV: E=Sophos;i="5.85,282,1624345200"; d="scan'208";a="208136146" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Sep 2021 01:26:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,282,1624345200"; d="scan'208";a="540346341" Received: from wuwenjun.sh.intel.com ([10.67.110.178]) by FMSMGA003.fm.intel.com with ESMTP; 10 Sep 2021 01:26:48 -0700 From: Wenjun Wu To: dev@dpdk.org, qi.z.zhang@intel.com Cc: Yuying Zhang Date: Fri, 10 Sep 2021 16:08:16 +0800 Message-Id: <20210910080821.18718-3-wenjun1.wu@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210910080821.18718-1-wenjun1.wu@intel.com> References: <20210910080821.18718-1-wenjun1.wu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 20.11 2/7] net/ice: refine flow priority usage X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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: Yuying Zhang This patch is not for LTS upstream, just for users to cherry-pick. Current code uses switch filter as backup of FDIR in non-pipeline mode and Value 1 denotes higher priority. This patch refines priority usage to match the original design of rte_flow attribute. When priority is 0, rules are create in switch filter first and FDIR is used as backup. When priority is 1, only switch filter is supported and has lower priority. Signed-off-by: Yuying Zhang --- drivers/net/ice/ice_generic_flow.c | 4 ++-- drivers/net/ice/ice_switch_filter.c | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/net/ice/ice_generic_flow.c b/drivers/net/ice/ice_generic_flow.c index ec141e8fa0..e195161a18 100644 --- a/drivers/net/ice/ice_generic_flow.c +++ b/drivers/net/ice/ice_generic_flow.c @@ -1927,9 +1927,9 @@ ice_register_parser(struct ice_flow_parser *parser, } else { if (parser->engine->type == ICE_FLOW_ENGINE_SWITCH || parser->engine->type == ICE_FLOW_ENGINE_HASH) - TAILQ_INSERT_TAIL(list, parser_node, node); - else if (parser->engine->type == ICE_FLOW_ENGINE_FDIR) TAILQ_INSERT_HEAD(list, parser_node, node); + else if (parser->engine->type == ICE_FLOW_ENGINE_FDIR) + TAILQ_INSERT_TAIL(list, parser_node, node); else if (parser->engine->type == ICE_FLOW_ENGINE_ACL) TAILQ_INSERT_HEAD(list, parser_node, node); else diff --git a/drivers/net/ice/ice_switch_filter.c b/drivers/net/ice/ice_switch_filter.c index db1586c970..45fa9723d2 100644 --- a/drivers/net/ice/ice_switch_filter.c +++ b/drivers/net/ice/ice_switch_filter.c @@ -1560,7 +1560,7 @@ ice_switch_parse_dcf_action(struct ice_dcf_adapter *ad, rule_info->sw_act.src = rule_info->sw_act.vsi_handle; rule_info->sw_act.flag = ICE_FLTR_RX; rule_info->rx = 1; - rule_info->priority = priority + 5; + rule_info->priority = 6 - priority; return 0; } @@ -1639,7 +1639,7 @@ ice_switch_parse_action(struct ice_pf *pf, rule_info->sw_act.vsi_handle = vsi->idx; rule_info->rx = 1; rule_info->sw_act.src = vsi->idx; - rule_info->priority = priority + 5; + rule_info->priority = 6 - priority; return 0; @@ -1749,6 +1749,9 @@ ice_switch_parse_pattern_action(struct ice_adapter *ad, ICE_NON_TUN; struct ice_pattern_match_item *pattern_match_item = NULL; + if (priority != 0 && priority != 1) + return rte_errno; + for (; item->type != RTE_FLOW_ITEM_TYPE_END; item++) { item_num++; if (item->type == RTE_FLOW_ITEM_TYPE_ETH) { -- 2.25.1