From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8543541E3A; Fri, 10 Mar 2023 10:37:51 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EEB1142D6D; Fri, 10 Mar 2023 10:36:45 +0100 (CET) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id 4E12442D4B; Fri, 10 Mar 2023 10:36:40 +0100 (CET) Received: from kwepemi500017.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4PY18C5YG3znWrf; Fri, 10 Mar 2023 17:33:47 +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.2507.21; Fri, 10 Mar 2023 17:36:38 +0800 From: Dongdong Liu To: , , , CC: , , , Subject: [PATCH 12/16] net/hns3: save hash algo to RSS filter list node Date: Fri, 10 Mar 2023 17:35:14 +0800 Message-ID: <20230310093518.5198-13-liudongdong3@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20230310093518.5198-1-liudongdong3@huawei.com> References: <20230310093518.5198-1-liudongdong3@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.28.79.22] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) 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 Save hash algo from rte flow RSS rule to RSS filter list node instead of struct hns3_rss_conf. Cc: stable@dpdk.org Signed-off-by: Huisong Li Signed-off-by: Dongdong Liu --- drivers/net/hns3/hns3_flow.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c index 3700d073b1..527874df44 100644 --- a/drivers/net/hns3/hns3_flow.c +++ b/drivers/net/hns3/hns3_flow.c @@ -1439,7 +1439,7 @@ hns3_disable_rss(struct hns3_hw *hw) } static int -hns3_parse_rss_algorithm(struct hns3_hw *hw, enum rte_eth_hash_function func, +hns3_parse_rss_algorithm(struct hns3_hw *hw, struct hns3_rss_conf *rss_conf, uint8_t *hash_algo) { const uint8_t hash_func_map[] = { @@ -1451,7 +1451,7 @@ hns3_parse_rss_algorithm(struct hns3_hw *hw, enum rte_eth_hash_function func, uint8_t key[HNS3_RSS_KEY_SIZE_MAX] = {0}; int ret; - if (func == RTE_ETH_HASH_FUNCTION_DEFAULT) { + if (rss_conf->conf.func == RTE_ETH_HASH_FUNCTION_DEFAULT) { ret = hns3_rss_get_algo_key(hw, hash_algo, key, hw->rss_key_size); if (ret != 0) { @@ -1466,20 +1466,21 @@ hns3_parse_rss_algorithm(struct hns3_hw *hw, enum rte_eth_hash_function func, * rte_flow_hash_algo) when this rule is delivered. */ if (__atomic_load_n(&hw->reset.resetting, __ATOMIC_RELAXED) && - *hash_algo != hw->rss_info.rte_flow_hash_algo) - *hash_algo = hw->rss_info.rte_flow_hash_algo; + *hash_algo != rss_conf->rte_flow_hash_algo) + *hash_algo = rss_conf->rte_flow_hash_algo; return 0; } - *hash_algo = hash_func_map[func]; + *hash_algo = hash_func_map[rss_conf->conf.func]; return 0; } static int -hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config) +hns3_hw_rss_hash_set(struct hns3_hw *hw, struct hns3_rss_conf *conf) { + struct rte_flow_action_rss *rss_config = &conf->conf; uint8_t rss_key[HNS3_RSS_KEY_SIZE_MAX] = {0}; bool use_default_key = false; uint64_t flow_types; @@ -1493,7 +1494,7 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config) use_default_key = true; } - ret = hns3_parse_rss_algorithm(hw, rss_config->func, &hash_algo); + ret = hns3_parse_rss_algorithm(hw, conf, &hash_algo); if (ret) return ret; @@ -1502,7 +1503,7 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config) hw->rss_key_size); if (ret) return ret; - hw->rss_info.rte_flow_hash_algo = hash_algo; + conf->rte_flow_hash_algo = hash_algo; /* Filter the unsupported flow types */ flow_types = rss_config->types ? @@ -1579,7 +1580,7 @@ hns3_config_rss_filter(struct hns3_hw *hw, struct hns3_rss_conf *conf) } /* Set hash algorithm and flow types by the user's config */ - return hns3_hw_rss_hash_set(hw, rss_act); + return hns3_hw_rss_hash_set(hw, conf); } static int -- 2.22.0