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 CA3EE43004; Tue, 8 Aug 2023 03:43:19 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 51C4643247; Tue, 8 Aug 2023 03:43:19 +0200 (CEST) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id 21ACC40A87 for ; Tue, 8 Aug 2023 03:43:17 +0200 (CEST) Received: from dggpeml100024.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4RKbWQ5CTszVk4n; Tue, 8 Aug 2023 09:41:22 +0800 (CST) Received: from [10.67.100.224] (10.67.100.224) by dggpeml100024.china.huawei.com (7.185.36.115) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 8 Aug 2023 09:43:15 +0800 Subject: Re: [PATCH] ethdev: add new symmetric hash function To: Ivan Malov , Xueming Li CC: Ori Kam , References: <20230524113827.7351-1-xuemingl@nvidia.com> <20230807115456.17478-1-xuemingl@nvidia.com> From: fengchengwen Message-ID: Date: Tue, 8 Aug 2023 09:43:15 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.100.224] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml100024.china.huawei.com (7.185.36.115) 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 On 2023/8/8 6:32, Ivan Malov wrote: > Hi, > > Please see my notes below. > > On Mon, 7 Aug 2023, Xueming Li wrote: > >> The new symmetric hash function swap src/dst L3 address and >> L4 ports automatically by sorting. >> >> Signed-off-by: Xueming Li >> --- >> lib/ethdev/rte_flow.h | 5 +++++ >> 1 file changed, 5 insertions(+) >> >> diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h >> index 86ed98c562..ec6dd170b5 100644 >> --- a/lib/ethdev/rte_flow.h >> +++ b/lib/ethdev/rte_flow.h >> @@ -3204,6 +3204,11 @@ enum rte_eth_hash_function { >>      * src or dst address will xor with zero pair. >>      */ >>     RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ, >> +    /** >> +     * Symmetric Toeplitz: src, dst will be swapped >> +     * automatically by sorting. > > This is very vague. Consider: > > For symmetric Toeplitz, four inputs are prepared as follows: > - src_addr | dst_addr > - src_addr ^ dst_addr > - src_port | dst_port > - src_port ^ dst_port > and then passed to the regular Toeplitz function. > > It is important to be as specific as possible > so that readers don't have to guess. +1 for this, I try to understand and google it, but can't find useful info. Also, how this new algo with src/dst only ? > > Thank you. > >> +     */ >> +    RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT, >>     RTE_ETH_HASH_FUNCTION_MAX, The new value will break the definition of MAX (maybe ABI compatible). but I found only hns3 drivers use RTE_ETH_HASH_FUNCTION_MAX, not sure the application will use it. >> }; >> >> --  >> 2.25.1 >> >> > > .