From patchwork Tue Jan 31 13:02:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dongdong Liu X-Patchwork-Id: 122755 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 468A841B8F; Tue, 31 Jan 2023 14:04:50 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BAA5942DA4; Tue, 31 Jan 2023 14:03:46 +0100 (CET) Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by mails.dpdk.org (Postfix) with ESMTP id 9AD2E42D33; Tue, 31 Jan 2023 14:03:40 +0100 (CET) Received: from kwepemi500017.china.huawei.com (unknown [172.30.72.57]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4P5lYX5Slnz16MpL; Tue, 31 Jan 2023 21:01:36 +0800 (CST) Received: from localhost.localdomain (10.28.79.22) by kwepemi500017.china.huawei.com (7.221.188.110) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 31 Jan 2023 21:03:37 +0800 From: Dongdong Liu To: , , , CC: , , , Subject: [PATCH V3 07/10] net/hns3: remove useless code when destroy valid RSS rule Date: Tue, 31 Jan 2023 21:02:57 +0800 Message-ID: <20230131130300.24713-8-liudongdong3@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20230131130300.24713-1-liudongdong3@huawei.com> References: <20230129105140.29921-1-liudongdong3@huawei.com> <20230131130300.24713-1-liudongdong3@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.28.79.22] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemi500017.china.huawei.com (7.221.188.110) X-CFilter-Loop: Reflected X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Huisong Li 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 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; }