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 9FC3BA0C4B; Wed, 10 Nov 2021 19:36:30 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6A4D34068B; Wed, 10 Nov 2021 19:36:30 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id CEE7840683 for ; Wed, 10 Nov 2021 19:36:28 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10164"; a="318937022" X-IronPort-AV: E=Sophos;i="5.87,224,1631602800"; d="scan'208";a="318937022" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2021 10:36:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,224,1631602800"; d="scan'208";a="669912001" Received: from silpixa00400072.ir.intel.com (HELO silpixa00400072.ger.corp.intel.com) ([10.237.222.91]) by orsmga005.jf.intel.com with ESMTP; 10 Nov 2021 10:36:26 -0800 From: Vladimir Medvedkin To: dev@dpdk.org Cc: Honnappa.Nagarahalli@arm.com, thomas@monjalon.net, Yipeng Wang , Sameh Gobriel , Bruce Richardson Subject: [PATCH v2] hash: clarify comments for RTE_HASH_BUCKET_ENTRIES Date: Wed, 10 Nov 2021 18:36:14 +0000 Message-Id: <20211110183614.218540-1-vladimir.medvedkin@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211108173935.133310-1-vladimir.medvedkin@intel.com> References: <20211108173935.133310-1-vladimir.medvedkin@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 This patch adds a comment for RTE_HASH_BUCKET_ENTRIES explaining why a particular value was chosen. Signed-off-by: Vladimir Medvedkin --- lib/hash/rte_cuckoo_hash.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/hash/rte_cuckoo_hash.h b/lib/hash/rte_cuckoo_hash.h index 85be49d3bb..eb2644f74b 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] = { #endif -/** 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, multiple 'struct rte_hash_bucket' can be fit + * on a single cache line (64 or 128 bytes long) without any gaps + * in memory between them due to alignment. + */ #define RTE_HASH_BUCKET_ENTRIES 8 #if !RTE_IS_POWER_OF_2(RTE_HASH_BUCKET_ENTRIES) -- 2.25.1