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 D11A4A0C4B; Mon, 8 Nov 2021 23:05:19 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 567D540151; Mon, 8 Nov 2021 23:05:19 +0100 (CET) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80072.outbound.protection.outlook.com [40.107.8.72]) by mails.dpdk.org (Postfix) with ESMTP id 27C2840040 for ; Mon, 8 Nov 2021 23:05:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/8WMft40lnNnarG/EHEdTCfdjjiiLEXlfrExX5uL6lc=; b=lUYQ2VL3lEBfOoV+ttFiNDkrh24VRbJyXvLEGxwKHkQkTuTbMk1mUJ8EwxH5ukIsSRipmrzDgVi9PO3To7SqDHpE8z/RvjMfhR+FdcLUo9IpXnUmW4eHIpjiRd9885rIcAkRJXBYgYJ1Qgz75uPh1ffgXppLmpPa2eZ9N1t6sRs= Received: from DB8PR09CA0035.eurprd09.prod.outlook.com (2603:10a6:10:a0::48) by VI1PR08MB3933.eurprd08.prod.outlook.com (2603:10a6:803:dd::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.13; Mon, 8 Nov 2021 22:05:03 +0000 Received: from DB5EUR03FT045.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:a0:cafe::1e) by DB8PR09CA0035.outlook.office365.com (2603:10a6:10:a0::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11 via Frontend Transport; Mon, 8 Nov 2021 22:05:03 +0000 X-MS-Exchange-Authentication-Results: spf=temperror (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=temperror action=none header.from=arm.com; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of arm.com: DNS Timeout) Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT045.mail.protection.outlook.com (10.152.21.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.14 via Frontend Transport; Mon, 8 Nov 2021 22:05:02 +0000 Received: ("Tessian outbound 7129402754f2:v108"); Mon, 08 Nov 2021 22:05:02 +0000 X-CR-MTA-TID: 64aa7808 Received: from f5a180453d4b.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 679E6098-C2B3-475D-99EC-B4B3FC2DE56D.1; Mon, 08 Nov 2021 22:04:56 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f5a180453d4b.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 08 Nov 2021 22:04:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WSaISJpP+Wl4T35hC7mfvDjxY6lv3hK/WmE2p//dBNzducsGpOpH+rR8Xne5ajZlXh2I0P0GnQQxuCIs2OQkxH/VUsuLawyPnUwgzD1e0hUgvRjjxwfir8IdlMw+/JDD3iqpuJBo7VW8y5lyH95EicRCxBoMfkx8GNlihR4GEmsFZtgh5eJm7BxuQZkGRzUN93Diig3VlwPQI/YZazaB8UnOee9Li45CAq9pmHTSeLV/JG5bwQgOHuB2ARD02iQhlED/N5PmCyvcTrw0abP3uvDTZ80JZIVrmMuss/+JAG7H8zkLhWnjIiBRpHT/2UFql053Q06lCkXCwspy9mdvIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/8WMft40lnNnarG/EHEdTCfdjjiiLEXlfrExX5uL6lc=; b=SbpzVj4ZdyEJv+BybAPTzwA9WrDZspMSwmS4bdYSEhD7LPLPlNuLWSi1SNVW51O1nWi8LOXriXaMlZNJwG6BZV2bmncLFgSfU8gY5vxp/OGUGiL+Tn6gxt/fh0cTVTs1LoUtxuqSiHNLW2+DQO7a0i8cjr8G4U1OGOVsUswowLTnBqzOUFa8CXcDPewdRM2IkrTdCFg8sk26+QypPBwU3rttnTLUgLqZT4Y7bwHYZM+lw6OaBWIQjzzqt370opURz4yn16FelMW+8Dt/HKlS2I5E3efdr4cikXyCq9Gvt8ouybhjr5YyjlvzzkpWWLXe6VwF0jL1rJYHYiaxs71gIA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/8WMft40lnNnarG/EHEdTCfdjjiiLEXlfrExX5uL6lc=; b=lUYQ2VL3lEBfOoV+ttFiNDkrh24VRbJyXvLEGxwKHkQkTuTbMk1mUJ8EwxH5ukIsSRipmrzDgVi9PO3To7SqDHpE8z/RvjMfhR+FdcLUo9IpXnUmW4eHIpjiRd9885rIcAkRJXBYgYJ1Qgz75uPh1ffgXppLmpPa2eZ9N1t6sRs= Received: from DBAPR08MB5814.eurprd08.prod.outlook.com (2603:10a6:10:1b1::6) by DB7PR08MB2954.eurprd08.prod.outlook.com (2603:10a6:5:1c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.16; Mon, 8 Nov 2021 22:04:55 +0000 Received: from DBAPR08MB5814.eurprd08.prod.outlook.com ([fe80::8501:86ca:a393:17b7]) by DBAPR08MB5814.eurprd08.prod.outlook.com ([fe80::8501:86ca:a393:17b7%9]) with mapi id 15.20.4669.016; Mon, 8 Nov 2021 22:04:55 +0000 From: Honnappa Nagarahalli To: Vladimir Medvedkin , "dev@dpdk.org" CC: "thomas@monjalon.net" , Yipeng Wang , Sameh Gobriel , Bruce Richardson , nd , Honnappa Nagarahalli , nd Thread-Topic: [dpdk-dev] [PATCH] hash: clarify comments for RTE_HASH_BUCKET_ENTRIES Thread-Index: AQHX1Mk4xPY8rlG7d0OZtYP0eNuDsKv6J05w Date: Mon, 8 Nov 2021 22:04:55 +0000 Message-ID: References: <20211108173935.133310-1-vladimir.medvedkin@intel.com> In-Reply-To: <20211108173935.133310-1-vladimir.medvedkin@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 95BB23D3EB1B85429C496ABF27A3C808.0 x-checkrecipientchecked: true Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; x-ms-publictraffictype: Email X-MS-Office365-Filtering-Correlation-Id: bdc0fe93-f267-450d-b153-08d9a303d05e x-ms-traffictypediagnostic: DB7PR08MB2954:|VI1PR08MB3933: x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:8882;OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: nIJqMlvkuqFLnOv93A9TRXbNaBhU8SeUjzq4vplk/wzpMkWxGlET2KckR6JlE2Enc40o//aBRSP6glp271H89Y7Byi8aMA/iC5E1Zvmb7KXYvbTnp+89Rw/UMNxR5Mo5VuVSFq7MzhvS7VU9vugiJU5qN8kJ7CXdFyo+GILQGWIbam2UGq/9khgQgsqrH/bsdml5ZBxujGYmiKiJQfIzGJAZUaKSIjfq2jrZ72x/2XfgYnGIPiV2B4HwokmqJRvAGsr9YXt7Mg3aBoaQkxGk+4j6rkJeYRM5zNL1bzc83XZpwNCmvL2o9/5YTT7yxH0IGlfq3KqETkFOPzg/iwVn19K+52h0NZqDY3IyLUMe3br0TUPzbYwVamDoiRyDpr82EHW8xLUXOdvbz3WCABJn2JqwbM9Ztj0rcUWEVQIcwnGEOIrA3TD5AKH5KDO284rhyY+wZDsocrCiJXiApug03HZAzSjybQDadSCbRk805gPRKEpdaXOvK5zauc1QXyA4kfIQlrOyEMGUDVNNv0UdFkL7gJfnddCSV3BAIt+v5+WcUNjLAc41j/chh2bnENxU0PTvK3WInnGPQMNpt6b27NqDyUo3wSjinxg4wYew7KPAKdTLobTSsfDbapqMA+zoyZRcX5JDn7rEgMZ/IQLPksEHlw5ACokyJLiZHXZEGG4+XPPgtiz67CJUQgqWOVSluInLBjxcgcu1OkP/thzBpg== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DBAPR08MB5814.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(52536014)(71200400001)(110136005)(6506007)(7696005)(9686003)(26005)(55016002)(76116006)(86362001)(83380400001)(508600001)(33656002)(8936002)(38100700002)(122000001)(186003)(8676002)(38070700005)(2906002)(4326008)(66446008)(64756008)(66946007)(66556008)(66476007)(316002)(54906003)(5660300002); DIR:OUT; SFP:1101; Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB2954 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT045.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: e661ef5e-0098-4843-77b2-08d9a303cc09 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +jxtJcYQsBin2SIApe4aEqogmIae7NtG/jrdWRY1pyPfJsyChsK9G9NPvF/JfY8r+7Fglv5esvZCmsFRCpHi6p/QE2Ld4PXjU5gK/SMaw/0x5MbyhGNwHdueWmPqEDF/jw6ke8k8HrSsxFa66ZwRP85Szdx6RacoLe9DfUfbQvb36lPOhBi9gnfPbzAihVPtTF1bLuDg0IVix0aSz9JdJ+7itw3NkHdvPoAxjQomUHSjJBPSplCx7tmjtYSSUmZmLRru8qlFQ9z/xTlKSvydcRAAkhJcf62b+hrYemWrE4dBcMkfO9VxWKQwbVzGOxZxE8tKpjzU4QkVxG7qS7EIfU+rWONa75gRxWvRO+Hg6cyVsrfiJEvN+EBTl25saAecBrid2lGjnUJxuBAgTGMvr2akwutLUC2qvut/AESBzv0rSwyLtgda8s1SJtpt0b/SkDeqYVtayuGrhsjAxR7f4l4gXjyhszOVqPOCEkkHjHLP0AR2Z4pNler1QAhTD0xVBy8TDeCuIkLPEr99tf32LVzF5XapqLF7uQxidhTqPCVD/N5TqOPCZFgGXOIms/cbC7qEuENtEKViPucKtUyziBB69h/Z/yPaCumFwQQzw/S+VOY1Y8r9WG25y3ecV9RaJ38D84DbvVd/QAHdjn7YrFSs6F31JHc3i46KqW6yC3WJJXBUDBC/ZR3TA/BRBs0rKm7UYO+bgduLucToDzsLYg== X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(6506007)(7696005)(81166007)(36860700001)(336012)(47076005)(86362001)(8676002)(316002)(82310400003)(33656002)(508600001)(186003)(52536014)(26005)(4326008)(8936002)(63370400001)(356005)(63350400001)(83380400001)(70586007)(54906003)(2906002)(110136005)(9686003)(55016002)(70206006)(5660300002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Nov 2021 22:05:02.5651 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bdc0fe93-f267-450d-b153-08d9a303d05e X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DB5EUR03FT045.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3933 Subject: Re: [dpdk-dev] [PATCH] hash: clarify comments for RTE_HASH_BUCKET_ENTRIES 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 Sender: "dev" >=20 > This patch adds a comment for RTE_HASH_BUCKET_ENTRIES explaining why a > particular value was chosen. >=20 > Signed-off-by: Vladimir Medvedkin > --- > lib/hash/rte_cuckoo_hash.h | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) >=20 > diff --git a/lib/hash/rte_cuckoo_hash.h b/lib/hash/rte_cuckoo_hash.h inde= x > 85be49d3bb..84dc55d86e 100644 > --- a/lib/hash/rte_cuckoo_hash.h > +++ b/lib/hash/rte_cuckoo_hash.h > @@ -101,7 +101,13 @@ const rte_hash_cmp_eq_t > cmp_jump_table[NUM_KEY_CMP_CASES] =3D { #endif >=20 >=20 > -/** Number of items per bucket. */ > +/** > + * Number of items per bucket. > + * 8 is a tradeoff between performance and memory consumption. > + * When it is equal to 8, the sizeof(struct rte_hash_bucket) equal to > + * RTE_CACHE_LINE_SIZE, thus, there are no gaps in memory between the > +hash > + * buckets due to their alignment. > + */ I think this should consider cache lines which are 128B. How about the foll= owing: "when it is equal to 8, multiple 'struct rte_hash_bucket' can be fit on a s= ingle cache line without any gaps in memory between them". On the other hand, I am wondering if 'struct rte_hash_bucket' needs to have= __rte_cache_aligned attribute. When the memory is allocated for the bucket= s we are requesting that it is aligned on the cache line boundary. That sho= uld be sufficient. Removing the attribute will help for local variables. So= me functions (for ex: rte_hash_cuckoo_move_insert_mw) have 2 local variable= s of this type and they can be placed on the same cache line if this attrib= ute is removed. > #define RTE_HASH_BUCKET_ENTRIES 8 >=20 > #if !RTE_IS_POWER_OF_2(RTE_HASH_BUCKET_ENTRIES) > -- > 2.25.1