All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Guo <jia.guo@intel.com>
To: beilei.xing@intel.com, xiaolong.ye@intel.com,
	qi.z.zhang@intel.com, jingjing.wu@intel.com
Cc: dev@dpdk.org, jia.guo@intel.com
Subject: [dpdk-dev] [dpdk-dev v2 2/2] net/iavf: fix rss algorithm configure issue
Date: Wed, 13 May 2020 16:21:28 -0400	[thread overview]
Message-ID: <20200513202128.112290-2-jia.guo@intel.com> (raw)
In-Reply-To: <20200513202128.112290-1-jia.guo@intel.com>

When configure rss rule, the etherdev rss hash function type should be
mapped to the corresponding virtchnl rss algorithm type.

Fixes: 7be10c3004be ("net/iavf: add RSS configuration for VF")
Signed-off-by: Jeff Guo <jia.guo@intel.com>
---
v2->v1:
fix a type for xor.
---
 drivers/net/iavf/iavf_hash.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c
index 6359ead76..975c84556 100644
--- a/drivers/net/iavf/iavf_hash.c
+++ b/drivers/net/iavf/iavf_hash.c
@@ -47,7 +47,7 @@ struct iavf_hash_match_type {
 
 struct iavf_rss_meta {
 	struct virtchnl_proto_hdrs *proto_hdrs;
-	uint32_t hash_function;
+	enum virtchnl_rss_algorithm rss_algorithm;
 };
 
 struct iavf_hash_flow_cfg {
@@ -1001,13 +1001,15 @@ iavf_hash_parse_action(struct iavf_pattern_match_item *pattern_match_item,
 
 			/* Check hash function and save it to rss_meta. */
 			if (rss->func == RTE_ETH_HASH_FUNCTION_SIMPLE_XOR)
-				rss_meta->hash_function =
-				RTE_ETH_HASH_FUNCTION_SIMPLE_XOR;
-
-			if (rss->func ==
-			    RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ)
-				rss_meta->hash_function =
-				RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ;
+				rss_meta->rss_algorithm =
+					VIRTCHNL_RSS_ALG_XOR_ASYMMETRIC;
+			else if (rss->func ==
+				 RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ)
+				rss_meta->rss_algorithm =
+					VIRTCHNL_RSS_ALG_TOEPLITZ_SYMMETRIC;
+			else
+				rss_meta->rss_algorithm =
+					VIRTCHNL_RSS_ALG_TOEPLITZ_ASYMMETRIC;
 
 			type_match_item =
 			rte_zmalloc("iavf_type_match_item",
@@ -1126,7 +1128,7 @@ iavf_hash_create(__rte_unused struct iavf_adapter *ad,
 	}
 
 	rss_cfg->proto_hdrs = *rss_meta->proto_hdrs;
-	rss_cfg->rss_algorithm = rss_meta->hash_function;
+	rss_cfg->rss_algorithm = rss_meta->rss_algorithm;
 
 	ret = iavf_add_del_rss_cfg(ad, rss_cfg, true);
 	if (!ret) {
-- 
2.20.1


  reply	other threads:[~2020-05-13  8:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-09 20:27 [dpdk-dev] net/iavf: fix rss algorithm configure issue Jeff Guo
2020-05-12  2:17 ` Zhang, Qi Z
2020-05-12  2:21   ` Zhang, Qi Z
2020-05-12 23:20     ` Jeff Guo
2020-05-13  2:17       ` Zhang, Qi Z
2020-05-13  3:12         ` Jeff Guo
2020-05-13 20:21 ` [dpdk-dev] [dpdk-dev v2 1/2] common/iavf: fix typo of rss algorithm type Jeff Guo
2020-05-13 20:21   ` Jeff Guo [this message]
2020-05-13  9:34     ` [dpdk-dev] [dpdk-dev v2 2/2] net/iavf: fix rss algorithm configure issue Zhang, Qi Z
2020-05-14  6:02       ` Ye Xiaolong
2020-05-14  5:59   ` [dpdk-dev] [dpdk-dev v2 1/2] common/iavf: fix typo of rss algorithm type Ye Xiaolong
2020-05-14  6:02   ` Ye Xiaolong

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=20200513202128.112290-2-jia.guo@intel.com \
    --to=jia.guo@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=xiaolong.ye@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.