[V3,07/10] net/hns3: remove useless code when destroy valid RSS rule

Message ID 20230131130300.24713-8-liudongdong3@huawei.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net/hns3: some bugfixes for rss |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Dongdong Liu Jan. 31, 2023, 1:02 p.m. UTC
From: Huisong Li <lihuisong@huawei.com>

The hw::rss_info::conf::func was set to the macro RTE_ETH_HASH_FUNCTION_MAX
and hw::rss_info::conf::queue was set to NULL when all rules are flushed,
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 <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_flow.c | 26 ++------------------------
 1 file changed, 2 insertions(+), 24 deletions(-)
  

Patch

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;
 	}