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 0B62D41FCD; Wed, 30 Aug 2023 14:42:11 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E7F9D40282; Wed, 30 Aug 2023 14:42:10 +0200 (CEST) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id 1A68340277 for ; Wed, 30 Aug 2023 14:42:09 +0200 (CEST) Received: from kwepemm600004.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4RbP4r3KS4zVjX2; Wed, 30 Aug 2023 20:39:40 +0800 (CST) Received: from [10.67.121.59] (10.67.121.59) by kwepemm600004.china.huawei.com (7.193.23.242) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Wed, 30 Aug 2023 20:42:06 +0800 Message-ID: Date: Wed, 30 Aug 2023 20:42:06 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: [PATCH v2 1/2] ethdev: add new symmetric hash function To: "Xueming(Steven) Li" , Ori Kam CC: "dev@dpdk.org" , "fengchengwen@huawei.com" , Ivan Malov References: <20230807115456.17478-1-xuemingl@nvidia.com> <20230827081745.31906-1-xuemingl@nvidia.com> <0926596b-7474-8821-55af-45699d5fc878@huawei.com> From: "lihuisong (C)" In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.121.59] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemm600004.china.huawei.com (7.193.23.242) 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 在 2023/8/30 16:38, Xueming(Steven) Li 写道: > >> -----Original Message----- >> From: lihuisong (C) >> Sent: 8/30/2023 15:51 >> To: Xueming(Steven) Li ; Ori Kam >> Cc: dev@dpdk.org; fengchengwen@huawei.com; Ivan Malov >> >> Subject: Re: [PATCH v2 1/2] ethdev: add new symmetric hash function >> >> Hi Xueming, >> >> 在 2023/8/27 16:17, Xueming Li 写道: >>> 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 | 7 +++++++ >>> 1 file changed, 7 insertions(+) >>> >>> diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index >>> 2ebb76dbc0..4f4421ca50 100644 >>> --- a/lib/ethdev/rte_flow.h >>> +++ b/lib/ethdev/rte_flow.h >>> @@ -3196,6 +3196,13 @@ enum rte_eth_hash_function { >>> * src or dst address will xor with zero pair. >>> */ >>> RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ, >>> + /** >>> + * Symmetric Toeplitz: L3 and L4 fields are sorted prior to >>> + * the hash function. >>> + * If src_ip > dst_ip, swap src_ip and dst_ip. >>> + * If src_port > dst_port, swap src_port and dst_port. >>> + */ >> If hash result are computed by the order: "src_ip+dst_ip+src_port+dst_port" >> How to obtain the value of every L3 and L4 field obove? >> I still cannot understand how to swap and set these values for these fields? > Hash result is computed by order ""src_ip+dst_ip+src_port+dst_port" > Here is a detailed explanation of standard hash and symmetric hash by key: > https://www.ndsl.kaist.edu/~kyoungsoo/papers/TR-symRSS.pdf > > If src_ip > dst_ip, swap them, then the input becomes: > "dst_ip+src_ip+src_port+dst_port" // please note src and dst IP are swapped. > Same for L4 ports. get it. What are the advantages of the symmetric toeplitz sort? Or why swap here? > >>> + RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT, >>> RTE_ETH_HASH_FUNCTION_MAX, >>> }; >>>