1 Star 0 Fork 76

叶青龙/dpdk

forked from src-openEuler/dpdk 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0248-net-hns3-separate-setting-and-clearing-RSS-rule.patch 3.60 KB
一键复制 编辑 原始数据 按行查看 历史
From 0667045e83f2ed2769e1e71947ce6530108739ed Mon Sep 17 00:00:00 2001
From: Huisong Li <[email protected]>
Date: Fri, 10 Mar 2023 17:35:12 +0800
Subject: net/hns3: separate setting and clearing RSS rule
[ upstream commit 1c3aeb2be4b8ef8b18846883ebbb9320f62cf097 ]
Separate the setting and clearing of RSS rule.
Signed-off-by: Huisong Li <[email protected]>
Signed-off-by: Dongdong Liu <[email protected]>
---
drivers/net/hns3/hns3_flow.c | 46 +++++++++++++++++-------------------
1 file changed, 22 insertions(+), 24 deletions(-)
diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index 9e51891bd9..80dda63afe 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1535,8 +1535,22 @@ hns3_update_indir_table(struct hns3_hw *hw,
}
static int
-hns3_config_rss_filter(struct hns3_hw *hw,
- const struct hns3_rss_conf *conf, bool add)
+hns3_reset_rss_filter(struct hns3_hw *hw, const struct hns3_rss_conf *conf)
+{
+ int ret;
+
+ if (!conf->valid)
+ return 0;
+
+ ret = hns3_disable_rss(hw);
+ if (ret)
+ hns3_err(hw, "RSS disable failed(%d)", ret);
+
+ return ret;
+}
+
+static int
+hns3_config_rss_filter(struct hns3_hw *hw, const struct hns3_rss_conf *conf)
{
uint64_t flow_types;
uint16_t num;
@@ -1553,19 +1567,6 @@ hns3_config_rss_filter(struct hns3_hw *hw,
.queue = conf->conf.queue,
};
- if (!add) {
- if (!conf->valid)
- return 0;
-
- ret = hns3_disable_rss(hw);
- if (ret) {
- hns3_err(hw, "RSS disable failed(%d)", ret);
- return ret;
- }
-
- return 0;
- }
-
/* Set rx queues to use */
num = RTE_MIN(hw->data->nb_rx_queues, rss_flow_conf.queue_num);
if (rss_flow_conf.queue_num > num)
@@ -1606,8 +1607,7 @@ hns3_clear_rss_filter(struct rte_eth_dev *dev)
rss_filter_ptr = TAILQ_FIRST(&hw->flow_rss_list);
while (rss_filter_ptr) {
TAILQ_REMOVE(&hw->flow_rss_list, rss_filter_ptr, entries);
- ret = hns3_config_rss_filter(hw, &rss_filter_ptr->filter_info,
- false);
+ ret = hns3_reset_rss_filter(hw, &rss_filter_ptr->filter_info);
if (ret)
rss_rule_fail_cnt++;
else
@@ -1636,7 +1636,7 @@ hns3_restore_rss_filter(struct hns3_hw *hw)
if (!filter->filter_info.valid)
continue;
- ret = hns3_config_rss_filter(hw, &filter->filter_info, true);
+ ret = hns3_config_rss_filter(hw, &filter->filter_info);
if (ret != 0) {
hns3_err(hw, "restore RSS filter failed, ret=%d", ret);
goto out;
@@ -1680,8 +1680,7 @@ hns3_rss_action_is_dup(struct hns3_hw *hw,
}
static int
-hns3_flow_parse_rss(struct rte_eth_dev *dev,
- const struct hns3_rss_conf *conf, bool add)
+hns3_flow_parse_rss(struct rte_eth_dev *dev, const struct hns3_rss_conf *conf)
{
struct hns3_adapter *hns = dev->data->dev_private;
struct hns3_hw *hw = &hns->hw;
@@ -1691,7 +1690,7 @@ hns3_flow_parse_rss(struct rte_eth_dev *dev,
return -EINVAL;
}
- return hns3_config_rss_filter(hw, conf, add);
+ return hns3_config_rss_filter(hw, conf);
}
static int
@@ -1778,7 +1777,7 @@ hns3_flow_create_rss_rule(struct rte_eth_dev *dev,
}
}
- ret = hns3_flow_parse_rss(dev, new_conf, true);
+ ret = hns3_flow_parse_rss(dev, new_conf);
if (ret != 0) {
rte_free(rss_filter_ptr);
return ret;
@@ -1961,8 +1960,7 @@ hns3_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow,
break;
case RTE_ETH_FILTER_HASH:
rss_filter_ptr = (struct hns3_rss_conf_ele *)flow->rule;
- ret = hns3_config_rss_filter(hw, &rss_filter_ptr->filter_info,
- false);
+ ret = hns3_reset_rss_filter(hw, &rss_filter_ptr->filter_info);
if (ret)
return rte_flow_error_set(error, EIO,
RTE_FLOW_ERROR_TYPE_HANDLE,
--
2.23.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yeqinglong01/dpdk.git
[email protected]:yeqinglong01/dpdk.git
yeqinglong01
dpdk
dpdk
master

搜索帮助