From: Huisong Li <lihuisong@huawei.com>
To: <stable@dpdk.org>, <luca.boccassi@gmail.com>
Cc: <liudongdong3@huawei.com>, <fengchengwen@huawei.com>,
<huangdaode@huawei.com>, <lihuisong@huawei.com>
Subject: [PATCH 20.11 2/3] net/hns3: fix RSS rule restore
Date: Sat, 12 Nov 2022 15:57:49 +0800 [thread overview]
Message-ID: <20221112075750.55623-3-lihuisong@huawei.com> (raw)
In-Reply-To: <20221112075750.55623-1-lihuisong@huawei.com>
[ upstream commit 0d81da25597a51519c1a085417fdfe2071183599 ]
The 'hns3_restore_rss_filter' function is used to restore RSS rule.
But this function calls the 'hns3_config_rss_filter' which sets the
last to invalid in flow RSS list. This causes the flow RSS list has
no valid rule.
Fixes: ec674cb742e5 ("net/hns3: fix flushing RSS rule")
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
drivers/net/hns3/hns3_flow.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index 13a795b1f0..facd4c5be7 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1504,7 +1504,6 @@ static int
hns3_config_rss_filter(struct hns3_hw *hw,
const struct hns3_rss_conf *conf, bool add)
{
- struct hns3_rss_conf_ele *rss_filter_ptr;
struct hns3_rss_conf *rss_info;
uint64_t flow_types;
uint16_t num;
@@ -1576,13 +1575,6 @@ hns3_config_rss_filter(struct hns3_hw *hw,
if (ret)
hns3_err(hw, "RSS config init fail(%d)", ret);
- /*
- * When create a new RSS rule, the old rule will be overlaid and set
- * invalid.
- */
- TAILQ_FOREACH(rss_filter_ptr, &hw->flow_rss_list, entries)
- rss_filter_ptr->filter_info.valid = false;
-
return ret;
}
@@ -1729,6 +1721,7 @@ hns3_flow_create_rss_rule(struct rte_eth_dev *dev,
{
struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
struct hns3_rss_conf_ele *rss_filter_ptr;
+ struct hns3_rss_conf_ele *filter_ptr;
const struct hns3_rss_conf *rss_conf;
int ret;
@@ -1753,6 +1746,14 @@ hns3_flow_create_rss_rule(struct rte_eth_dev *dev,
hns3_rss_conf_copy(&rss_filter_ptr->filter_info, &rss_conf->conf);
rss_filter_ptr->filter_info.valid = true;
+
+ /*
+ * When create a new RSS rule, the old rule will be overlaid and set
+ * invalid.
+ */
+ TAILQ_FOREACH(filter_ptr, &hw->flow_rss_list, entries)
+ filter_ptr->filter_info.valid = false;
+
TAILQ_INSERT_TAIL(&hw->flow_rss_list, rss_filter_ptr, entries);
flow->rule = rss_filter_ptr;
flow->filter_type = RTE_ETH_FILTER_HASH;
--
2.33.0
next prev parent reply other threads:[~2022-11-12 7:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-12 7:57 [PATCH 20.11 0/3] backport some bugfixes for hns3 Huisong Li
2022-11-12 7:57 ` [PATCH 20.11 1/3] net/hns3: extract functions to create RSS and FDIR flow rule Huisong Li
2022-11-12 7:57 ` Huisong Li [this message]
2022-11-12 7:57 ` [PATCH 20.11 3/3] net/hns3: fix clearing hardware MAC statistics Huisong Li
2022-11-15 11:49 ` [PATCH 20.11 0/3] backport some bugfixes for hns3 Luca Boccassi
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=20221112075750.55623-3-lihuisong@huawei.com \
--to=lihuisong@huawei.com \
--cc=fengchengwen@huawei.com \
--cc=huangdaode@huawei.com \
--cc=liudongdong3@huawei.com \
--cc=luca.boccassi@gmail.com \
--cc=stable@dpdk.org \
/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).