DPDK patches and discussions
 help / color / mirror / Atom feed
From: Wenjun Wu <wenjun1.wu@intel.com>
To: dev@dpdk.org, qi.z.zhang@intel.com
Cc: Yuying Zhang <yuying.zhang@intel.com>
Subject: [dpdk-dev] [PATCH 20.11 2/7] net/ice: refine flow priority usage
Date: Fri, 10 Sep 2021 16:08:16 +0800	[thread overview]
Message-ID: <20210910080821.18718-3-wenjun1.wu@intel.com> (raw)
In-Reply-To: <20210910080821.18718-1-wenjun1.wu@intel.com>

From: Yuying Zhang <yuying.zhang@intel.com>

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 <yuying.zhang@intel.com>
---
 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


  parent reply	other threads:[~2021-09-10  8:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-10  8:08 [dpdk-dev] [PATCH 20.11 0/7] backport feature support to DPDK 20.11 Wenjun Wu
2021-09-10  8:08 ` [dpdk-dev] [PATCH 20.11 1/7] net/ice: add priority check for flow filters Wenjun Wu
2021-09-10  8:08 ` Wenjun Wu [this message]
2021-09-10  8:08 ` [dpdk-dev] [PATCH 20.11 3/7] net/ice: support 256 queues Wenjun Wu
2021-09-10  8:08 ` [dpdk-dev] [PATCH 20.11 4/7] net/ice: fix error set of queue number Wenjun Wu
2021-09-10  8:08 ` [dpdk-dev] [PATCH 20.11 5/7] net/ice: support 6-tuple RSS Wenjun Wu
2021-09-10  8:08 ` [dpdk-dev] [PATCH 20.11 6/7] net/ice: add L4 support for QinQ switch filter Wenjun Wu
2021-09-10  8:08 ` [dpdk-dev] [PATCH 20.11 7/7] net/ice/base: support L4 " Wenjun Wu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210910080821.18718-3-wenjun1.wu@intel.com \
    --to=wenjun1.wu@intel.com \
    --cc=dev@dpdk.org \
    --cc=qi.z.zhang@intel.com \
    --cc=yuying.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).