From 1f32e5059ee95c4433d1c37034e02f8c4a722418 Mon Sep 17 00:00:00 2001 From: Huisong Li Date: Tue, 31 Jan 2023 21:02:57 +0800 Subject: net/hns3: remove useless code when destroy valid RSS rule [ upstream commit 546031ba551485c3e3aa57c3698975c2852cbef1 ] When all rules are flushed the hw::rss_info::conf::func set to RTE_ETH_HASH_FUNCTION_MAX and hw::rss_info::conf::queue set to NULL which indicates no flow rules is issued. See: commit eb158fc756a5 ("net/hns3: fix config when creating RSS rule after flush"). Actually, the way determining whether there are rules has been changed by walking the flow RSS list. See: commit 705a50800334 ("net/hns3: fix RSS filter restore"). In addition, the rte_flow_action_rss from user isn't saved to 'conf' in hw->rss_info now. So this code can be removed. Fixes: eb158fc756a5 ("net/hns3: fix config when creating RSS rule after flush") Fixes: 705a50800334 ("net/hns3: fix RSS filter restore") Cc: stable@dpdk.org Signed-off-by: Huisong Li Signed-off-by: Dongdong Liu --- drivers/net/hns3/hns3_flow.c | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c index 303275ae93..7adde16cbc 100644 --- a/drivers/net/hns3/hns3_flow.c +++ b/drivers/net/hns3/hns3_flow.c @@ -1279,19 +1279,8 @@ hns3_action_rss_same(const struct rte_flow_action_rss *comp, bool rss_key_is_same; bool func_is_same; - /* - * When user flush all RSS rule, RSS func is set invalid with - * RTE_ETH_HASH_FUNCTION_MAX. Then the user create a flow after - * flushed, any validate RSS func is different with it before - * flushed. Others, when user create an action RSS with RSS func - * specified RTE_ETH_HASH_FUNCTION_DEFAULT, the func is the same - * between continuous RSS flow. - */ - if (comp->func == RTE_ETH_HASH_FUNCTION_MAX) - func_is_same = false; - else - func_is_same = (with->func != RTE_ETH_HASH_FUNCTION_DEFAULT) ? - (comp->func == with->func) : true; + func_is_same = (with->func != RTE_ETH_HASH_FUNCTION_DEFAULT) ? + (comp->func == with->func) : true; if (with->key_len == 0 || with->key == NULL) rss_key_is_same = 1; @@ -1533,7 +1522,6 @@ static int hns3_config_rss_filter(struct hns3_hw *hw, const struct hns3_rss_conf *conf, bool add) { - struct hns3_rss_conf *rss_info; uint64_t flow_types; uint16_t num; int ret; @@ -1560,7 +1548,6 @@ hns3_config_rss_filter(struct hns3_hw *hw, /* Update the useful flow types */ rss_flow_conf.types = flow_types; - rss_info = &hw->rss_info; if (!add) { if (!conf->valid) return 0; @@ -1571,15 +1558,6 @@ hns3_config_rss_filter(struct hns3_hw *hw, return ret; } - if (rss_flow_conf.queue_num) { - /* - * Due the content of queue pointer have been reset to - * 0, the rss_info->conf.queue should be set to NULL - */ - rss_info->conf.queue = NULL; - rss_info->conf.queue_num = 0; - } - return 0; } -- 2.23.0