1 Star 0 Fork 75

sky/dpdk

forked from src-openEuler/dpdk 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0250-net-hns3-save-hash-algo-to-RSS-filter-list-node.patch 3.14 KB
一键复制 编辑 原始数据 按行查看 历史
From e439b6f69b496ab010cff1b87f7a8cd83e258faf Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong@huawei.com>
Date: Fri, 10 Mar 2023 17:35:14 +0800
Subject: net/hns3: save hash algo to RSS filter list node
[ upstream commit 9d34b8a181bf022fe3a3a3ae8511f3d921fc5c67 ]
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 3ac5279538..f073adebb6 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.23.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/nlgwcy/dpdk.git
git@gitee.com:nlgwcy/dpdk.git
nlgwcy
dpdk
dpdk
master

搜索帮助