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 0BEDC41E3A; Fri, 10 Mar 2023 10:37:15 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1E78C42D3E; Fri, 10 Mar 2023 10:36:38 +0100 (CET) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id D886E42D0D; Fri, 10 Mar 2023 10:36:33 +0100 (CET) Received: from kwepemi500017.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4PY17m6q34zSknC; Fri, 10 Mar 2023 17:33:24 +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:32 +0800 From: Dongdong Liu To: , , , CC: , , , Subject: [PATCH 07/16] net/hns3: separate the setting of hash key Date: Fri, 10 Mar 2023 17:35:09 +0800 Message-ID: <20230310093518.5198-8-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 The settings of hash key comes from the ethdev ops (like, dev_configure and rss_hash_update) and rte_flow API. For the ethdev ops, driver has to save it to rss_info::key in hns3_hw structure so as to it can be restored when reset is triggered. While rte_flow API no need to use this field to save, they has a global flow_rss_list to maintain all rules which save hash key. And hash key can be restored by this rule information during the reset phase. Cc: stable@dpdk.org Signed-off-by: Huisong Li Signed-off-by: Dongdong Liu --- drivers/net/hns3/hns3_rss.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c index 88ba0757b5..be717b7641 100644 --- a/drivers/net/hns3/hns3_rss.c +++ b/drivers/net/hns3/hns3_rss.c @@ -376,8 +376,7 @@ hns3_rss_set_algo_key(struct hns3_hw *hw, uint8_t hash_algo, return ret; } } - /* Update the shadow RSS key with user specified */ - memcpy(hw->rss_info.key, key, hw->rss_key_size); + return 0; } @@ -671,6 +670,8 @@ hns3_dev_rss_hash_update(struct rte_eth_dev *dev, key, hw->rss_key_size); if (ret) goto set_algo_key_fail; + /* Update the shadow RSS key with user specified */ + memcpy(hw->rss_info.key, key, hw->rss_key_size); } rte_spinlock_unlock(&hw->lock); -- 2.22.0