DPDK patches and discussions
 help / color / mirror / Atom feed
From: Dongdong Liu <liudongdong3@huawei.com>
To: <dev@dpdk.org>, <ferruh.yigit@amd.com>, <thomas@monjalon.net>,
	<andrew.rybchenko@oktetlabs.ru>
Cc: <stable@dpdk.org>, <yisen.zhuang@huawei.com>,
	<liudongdong3@huawei.com>, <lihuisong@huawei.com>
Subject: [PATCH 12/16] net/hns3: save hash algo to RSS filter list node
Date: Fri, 10 Mar 2023 17:35:14 +0800	[thread overview]
Message-ID: <20230310093518.5198-13-liudongdong3@huawei.com> (raw)
In-Reply-To: <20230310093518.5198-1-liudongdong3@huawei.com>

From: Huisong Li <lihuisong@huawei.com>

Save hash algo from rte flow RSS rule to RSS filter list node
instead of struct hns3_rss_conf.

Cc: stable@dpdk.org

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_flow.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index 3700d073b1..527874df44 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1439,7 +1439,7 @@ hns3_disable_rss(struct hns3_hw *hw)
 }
 
 static int
-hns3_parse_rss_algorithm(struct hns3_hw *hw, enum rte_eth_hash_function func,
+hns3_parse_rss_algorithm(struct hns3_hw *hw, struct hns3_rss_conf *rss_conf,
 			 uint8_t *hash_algo)
 {
 	const uint8_t hash_func_map[] = {
@@ -1451,7 +1451,7 @@ hns3_parse_rss_algorithm(struct hns3_hw *hw, enum rte_eth_hash_function func,
 	uint8_t key[HNS3_RSS_KEY_SIZE_MAX] = {0};
 	int ret;
 
-	if (func == RTE_ETH_HASH_FUNCTION_DEFAULT) {
+	if (rss_conf->conf.func == RTE_ETH_HASH_FUNCTION_DEFAULT) {
 		ret = hns3_rss_get_algo_key(hw, hash_algo, key,
 					    hw->rss_key_size);
 		if (ret != 0) {
@@ -1466,20 +1466,21 @@ hns3_parse_rss_algorithm(struct hns3_hw *hw, enum rte_eth_hash_function func,
 		 * rte_flow_hash_algo) when this rule is delivered.
 		 */
 		if (__atomic_load_n(&hw->reset.resetting, __ATOMIC_RELAXED) &&
-		    *hash_algo != hw->rss_info.rte_flow_hash_algo)
-			*hash_algo = hw->rss_info.rte_flow_hash_algo;
+		    *hash_algo != rss_conf->rte_flow_hash_algo)
+			*hash_algo = rss_conf->rte_flow_hash_algo;
 
 		return 0;
 	}
 
-	*hash_algo = hash_func_map[func];
+	*hash_algo = hash_func_map[rss_conf->conf.func];
 
 	return 0;
 }
 
 static int
-hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
+hns3_hw_rss_hash_set(struct hns3_hw *hw, struct hns3_rss_conf *conf)
 {
+	struct rte_flow_action_rss *rss_config = &conf->conf;
 	uint8_t rss_key[HNS3_RSS_KEY_SIZE_MAX] = {0};
 	bool use_default_key = false;
 	uint64_t flow_types;
@@ -1493,7 +1494,7 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
 		use_default_key = true;
 	}
 
-	ret = hns3_parse_rss_algorithm(hw, rss_config->func, &hash_algo);
+	ret = hns3_parse_rss_algorithm(hw, conf, &hash_algo);
 	if (ret)
 		return ret;
 
@@ -1502,7 +1503,7 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
 				    hw->rss_key_size);
 	if (ret)
 		return ret;
-	hw->rss_info.rte_flow_hash_algo = hash_algo;
+	conf->rte_flow_hash_algo = hash_algo;
 
 	/* Filter the unsupported flow types */
 	flow_types = rss_config->types ?
@@ -1579,7 +1580,7 @@ hns3_config_rss_filter(struct hns3_hw *hw, struct hns3_rss_conf *conf)
 	}
 
 	/* Set hash algorithm and flow types by the user's config */
-	return hns3_hw_rss_hash_set(hw, rss_act);
+	return hns3_hw_rss_hash_set(hw, conf);
 }
 
 static int
-- 
2.22.0


  parent reply	other threads:[~2023-03-10  9:37 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-10  9:35 [PATCH 00/16] net/hns3: some code refactor for hns3 RSS Dongdong Liu
2023-03-10  9:35 ` [PATCH 01/16] net/hns3: fix possible truncation of hash key when config Dongdong Liu
2023-03-10 19:36   ` Ferruh Yigit
2023-03-29  1:56     ` lihuisong (C)
2023-03-10  9:35 ` [PATCH 02/16] net/hns3: fix possible truncation of redirection table Dongdong Liu
2023-03-10 19:36   ` Ferruh Yigit
2023-03-10  9:35 ` [PATCH 03/16] net/hns3: use hardware config to report hash key Dongdong Liu
2023-03-10  9:35 ` [PATCH 04/16] net/hns3: use hardware config to report hash types Dongdong Liu
2023-03-10  9:35 ` [PATCH 05/16] net/hns3: use hardware config to report redirection table Dongdong Liu
2023-03-10  9:35 ` [PATCH 06/16] net/hns3: separate the setting of hash algorithm Dongdong Liu
2023-03-10 19:36   ` Ferruh Yigit
2023-03-29  1:58     ` lihuisong (C)
2023-03-29  8:13       ` Ferruh Yigit
2023-03-10  9:35 ` [PATCH 07/16] net/hns3: separate the setting of hash key Dongdong Liu
2023-03-10  9:35 ` [PATCH 08/16] net/hns3: separate the setting of redirection table Dongdong Liu
2023-03-10  9:35 ` [PATCH 09/16] net/hns3: separate the setting of RSS types Dongdong Liu
2023-03-10  9:35 ` [PATCH 10/16] net/hns3: separate the setting and clearing of RSS rule Dongdong Liu
2023-03-10  9:35 ` [PATCH 11/16] net/hns3: use new RSS rule to configure hardware Dongdong Liu
2023-03-10  9:35 ` Dongdong Liu [this message]
2023-03-10  9:35 ` [PATCH 13/16] net/hns3: adding queue buffer size hash rule allowed Dongdong Liu
2023-03-10  9:35 ` [PATCH 14/16] net/hns3: separate rte flow RSS config from hns3 rss conf Dongdong Liu
2023-03-10  9:35 ` [PATCH 15/16] net/hns3: reimplement hash flow function Dongdong Liu
2023-03-10  9:35 ` [PATCH 16/16] net/hns3: add the verification of RSS types Dongdong Liu
2023-03-10 20:58 ` [PATCH 00/16] net/hns3: some code refactor for hns3 RSS Ferruh Yigit

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=20230310093518.5198-13-liudongdong3@huawei.com \
    --to=liudongdong3@huawei.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    --cc=lihuisong@huawei.com \
    --cc=stable@dpdk.org \
    --cc=thomas@monjalon.net \
    --cc=yisen.zhuang@huawei.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).