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 917B5A0C41; Sun, 7 Nov 2021 16:33:47 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3A88D40151; Sun, 7 Nov 2021 16:33:47 +0100 (CET) Received: from mail-yb1-f172.google.com (mail-yb1-f172.google.com [209.85.219.172]) by mails.dpdk.org (Postfix) with ESMTP id 7850040151 for ; Sun, 7 Nov 2021 05:53:31 +0100 (CET) Received: by mail-yb1-f172.google.com with SMTP id q74so34135851ybq.11 for ; Sat, 06 Nov 2021 21:53:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gadgeon.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dYbEVhE9h04BIXtHJ5Bys4gATYPEpgTTGEhyGyEHzGc=; b=IONWbxOoO8jxUIODTwUx3xstmQEx10dN5l7q5yue9vLKz9dtpp4JTRld7p4g6j31eP 80GHgxJJTGTvKy1lTiaHiBjdAKkwV587L5LH0w3K0QaItauwOQBkBd3xIl8ZZmokyOAO d2CNiRlLs8D+Hr6nPY0E+OmgEdWZEEAZ6q1r0/yNMfe5mxZcbh6gmYQcMq6P5D7Hdm75 8Pnhmv5PH+lhZiOJJ+5mNNDWqYJiXBqdcnEmLjbiil7nT2IcM/Hacro+DrikaAk4qVpM NgmgSAJMaxoUtCnpnVGeA6Vch+szmex2Hc20s3f6qN+YdL/npsxNsC4VOb+jGJaorEM6 cddQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dYbEVhE9h04BIXtHJ5Bys4gATYPEpgTTGEhyGyEHzGc=; b=zmOV5uqXlnJuV0q1oqnJ+M+q6NGGZsqEWumyWKrVRa+m76p/CeMw0ZalikiJBNqvlG zAPBdJZQJH4ikYhPDtcowBP1V914qh9mmGTVqANIQvGG0+MttF3XlYk28hv8+kx87mdc re3jQgtRImCZOkSH3ESykzzGPaHMWQBReGZYohIJ0erHM3B+KM3S5/zgR51LDXdj/+sQ IcTJYWXHc/qaJwS+5wwTL0HSrNkalKCUkyTPAOXADKVZ7z04sm7Xzhu9T25ky8KYoaY7 lFdPnOWv2mJypo846HSVOCYjINXOiDBxlb47raf8Zg153UAbLKh/ifv3YjMPBZSlfKEX o25A== X-Gm-Message-State: AOAM531y5mxeqjccbWaxpO30ew3ud+NOiBCNq+ghwbObClGTDknQsDVp InWknk9bWBHgvVkjTCtkB/nbnIhl8MB3UgIVHaB98w== X-Google-Smtp-Source: ABdhPJzVhxEoC7Pql11JouHsElFreNt7hekLGInns43oidr0WYHDMMpAZrSX5XwAMdUrgch50vtzrZPuv/6J7EVp/Hc= X-Received: by 2002:a25:dc42:: with SMTP id y63mr39552878ybe.402.1636260810821; Sat, 06 Nov 2021 21:53:30 -0700 (PDT) MIME-Version: 1.0 References: <6c1c908e-6a9a-c50d-0fa3-be61770ef97c@intel.com> <3060108.LiUVKm96O0@thomas> In-Reply-To: <3060108.LiUVKm96O0@thomas> From: Syam Prasad N Pearson Date: Sun, 7 Nov 2021 04:53:02 +0530 Message-ID: To: Thomas Monjalon Cc: "Medvedkin, Vladimir" , "Kinsella, Ray" , "users@dpdk.org" , "dev@dpdk.org" , "Wang, Yipeng1" , "Gobriel, Sameh" , "Richardson, Bruce" X-Mailman-Approved-At: Sun, 07 Nov 2021 16:33:46 +0100 Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [dpdk-dev] Doubt regarding DPDK hash Library implementation 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" Thank you all. On Thu, Nov 4, 2021 at 10:19 PM Thomas Monjalon wrote: > 04/11/2021 17:39, Medvedkin, Vladimir: > > >> 01/11/2021 11:55, Syam Prasad N Pearson: > > >>> /** Number of items per bucket. */ > > >>> *#define RTE_HASH_BUCKET_ENTRIES 8* > > >>> > > >>> defined inside: > > >>> dpdk-20.11.3/dpdk-stable-20.11.3/lib/librte_hash /rte_cuckoo_hash.h > > >>> > > >>> Why does the library take this value as *8*, is there any particular > > >>> reason for this? what if it is 16,32... etc. > > > > Yes, RTE_HASH_BUCKET_ENTRIES can be any power of 2. > > The reason for choosing 8 is a tradeoff between performance and memory. > > 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. > > That's a good comment to add in the code. > > > -- Regards, Syam Pearson Syam Pearson Gadgeon Smart Systems m: +91-97460-44420 (India) w: www.gadgeon.com www.delpheon.io [image: www.linkedin.com/in/kirankumar-c-32349964]