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 B283FA0C56 for ; Thu, 4 Nov 2021 17:40:15 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B662942758; Thu, 4 Nov 2021 17:40:10 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 6E97E411C9; Thu, 4 Nov 2021 17:40:07 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10157"; a="231988890" X-IronPort-AV: E=Sophos;i="5.87,209,1631602800"; d="scan'208";a="231988890" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2021 09:40:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,209,1631602800"; d="scan'208";a="450503585" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orsmga003.jf.intel.com with ESMTP; 04 Nov 2021 09:40:05 -0700 Received: from orsmsx604.amr.corp.intel.com (10.22.229.17) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 4 Nov 2021 09:40:05 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Thu, 4 Nov 2021 09:40:05 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.172) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Thu, 4 Nov 2021 09:40:05 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VM5jiM7LlJrYZFdZ93SfXTAaetgQFnTID1f0aWOrdfa1NbjaORjYUphMlGXJUdIdcu9YBA7dpgs7KWPiQ7djw4SIxdnYkAjYL/AWc9yTTl5ThNetiQ9gfwjRvcWr0Lk5iXc+0eWpijDFwPMQxSgowRqbCcLjb1A9ZoDGVM2jkf//NmK9Rg/WBID/1+LgOcfvwWv7hChxeu5Y6s1OGRRoG5b+22O3vGBAfOufVGTjvuw+RsKgp6Y7100dUugfN2fmkjy3GEbirZkNwVRxKK83SEAw6yfsw2rhRxDNUZ6bluc1CYP8ZIuR3GTzTdOWd6ew8AHSuALqkRF/siBppJjexQ== 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=iPywPHxqtSQrnO0UjMEnGp2/lMspH3pPnSYRexRQgO4=; b=f1qi62BNnTqA25pJ24GAY9lv3JlU7UkKci4D7lLCH3A2+BvHqVFl84B+EgI5Ooftfr6ySxz5MDh+HtUo2dSAZ+0Ck/NaMQm342rgYvV65ErruyRy+FxItz3DL/kT9ys18LD+Tfy62Cgdh+e+QleBJkwRaZFRhkBMAZPP+mPL6KMdmp437pOo8LjVmqrw2R9FCBUS+M1cJYNzAdo/YpZYyU/yvS+gw6nxKLa7MvVtisXU5yK1jMQGcg4TTDfQUtav1tug/JdAmnD0SnGkFl13Yl+hUAXGkIuSXKYezKu67PjtOVU2lkPqKhSt+q4Dh1rohy2wNNGmpXxkjdzi/RKC1g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iPywPHxqtSQrnO0UjMEnGp2/lMspH3pPnSYRexRQgO4=; b=anceaJx/hdPcToAEQPA7OkX0zH1LfMFKaRXRQ2unnK3c3D4fTdBc17NKlahUWeHLh+Uq08+4GhzwtHofnyXgvoCcUtWb054NyRijtkScp3y6Pz/9o06s3FsPj5vo698Ue8/5bz61dxcvDSMFWmPJKTW/bQFaHk8ASwVVHf/+fXs= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; Received: from CO1PR11MB5012.namprd11.prod.outlook.com (2603:10b6:303:90::18) by MWHPR11MB1726.namprd11.prod.outlook.com (2603:10b6:300:23::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.14; Thu, 4 Nov 2021 16:39:57 +0000 Received: from CO1PR11MB5012.namprd11.prod.outlook.com ([fe80::442b:2192:c62b:c6c3]) by CO1PR11MB5012.namprd11.prod.outlook.com ([fe80::442b:2192:c62b:c6c3%8]) with mapi id 15.20.4669.012; Thu, 4 Nov 2021 16:39:57 +0000 Subject: Re: [dpdk-dev] Doubt regarding DPDK hash Library implementation To: "Kinsella, Ray" , Thomas Monjalon , Syam Prasad N Pearson CC: "users@dpdk.org" , "dev@dpdk.org" , "Wang, Yipeng1" , "Gobriel, Sameh" , "Richardson, Bruce" References: <35568061.LRaTyjEjOM@thomas> From: "Medvedkin, Vladimir" Message-ID: <6c1c908e-6a9a-c50d-0fa3-be61770ef97c@intel.com> Date: Thu, 4 Nov 2021 17:39:50 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.14.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO2P265CA0356.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:d::32) To CO1PR11MB5012.namprd11.prod.outlook.com (2603:10b6:303:90::18) MIME-Version: 1.0 Received: from [192.198.151.53] (192.198.151.53) by LO2P265CA0356.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:d::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11 via Frontend Transport; Thu, 4 Nov 2021 16:39:55 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b64d8632-4ec5-4d3a-f711-08d99fb1bc8c X-MS-TrafficTypeDiagnostic: MWHPR11MB1726: X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: x9FSsL5pQoxN5VzV2Ox3livkd18E/nywGiDwzTAbWzCjEVGxhMCPBvmgJvcDeBs71HpUPgz1nJ0A+TMsBD4d1IRh3MBdT6cCnK3EKXtgNeaBmWP7PflrtHs7QVIwWzG6LGtDgDwP6T3a+eYUm2lH7OsZH2VYhKLbz1VAVsg+QXYFpPJPIEf5rJBmgKHXE3elaXxOSNZ2SRY1MOiLBLeTLnni3eJ8x9BdXOcCPco9EOUMBeqpu/wGiU+O5QPUnoU6u4t7W+tgsklW16MWvLOsnvzRm1OXQELvw6JWUAcGssnxQpf/YokouQMbDgaSclMthml0koX6vm3AXkg6uRt+3NJ6o5g55+Do6qD0h5O3x5am5MQxBlpxvTh2JxmEc8NQUdJ5NLu1+Vuata2gacOYNXrGr3n2nwVSPAiTfaK1o6jBfzSKGOCIwrWGzGQvw8ECbBsUM94o5bNzO1uz/gvCPkk03nMiyMcSwOWg1BonM2xvf8kRAfl1OiC3l8sSOdJTGLepypBTAMDdUZ8SeiNHwkfbmcrfhrD8Z5Kvkw7q868JAFjcMXqjsbkFxbAyjIxVXiYC08+x5hNZ3kQGQKsJ0MTABUGLYPFVTjFpLtem1WvqNyJv1GccaODQBiO2gQEFivTh/daaH+eaqI2qLe2S8Jfm3pZG+vFj4xRYyVUrMsjDAu8g+fDbpHQdiHtZQd7LjMduPPIJV3zQLpCHWvaFwKuZRdogFGzPcW+1HXAlTUrWvctQ+GqogsQe2vs223RZ59VHiBKYh1RDoVJZ0aGiLw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR11MB5012.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(8676002)(956004)(110136005)(53546011)(38100700002)(6666004)(107886003)(31686004)(66556008)(66476007)(26005)(36756003)(66946007)(4326008)(83380400001)(82960400001)(2906002)(2616005)(5660300002)(6486002)(8936002)(31696002)(86362001)(54906003)(316002)(16576012)(186003)(6706004)(508600001)(3940600001)(45980500001)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?bndBU3VhZUpIcEQxQStwZkJSTFFyTlJHbVRVTG5ldVM1ZTduS2k1dXRaOG9w?= =?utf-8?B?T3FzaWxtOE9pRHVRZVhJcENhMGVoOVVGMWpLK043WkFUcnVncmwyWkFDRnFF?= =?utf-8?B?Q2huVGkxNU90YWJrb2F6WFJIcTh6VCtqbkgzbU5HU2l5dDVHQTFuNjY1T3pl?= =?utf-8?B?cyt3b1A1NEN2bUpNd29KTXY0a1RBRGFjZVA4dHNndWxjQjVuM0R4UUROdjFy?= =?utf-8?B?UnpEdmx1Zm45cnIzNE5qU2pMb0Nrb1ZSVG9qM21QYW4wL0JFbWlJWUJ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WXU3RDh0RXNvRHJ5SUhoQ3VaOUNsblM4K0JkQldLaytzcnRZ?= =?utf-8?B?dUtLc1hBVS9ITjQ2VGZmZFRSTVBtekRPeUR6VWUrbk00clk4NVczTVRCUXI4?= =?utf-8?B?cDFGV3N1SmtlaUt0ZTJsU2hMSk5wTG84Yk1PUXNienRGNlpBS3Bvc1Y3ajdH?= =?utf-8?Q?VNeF0+8i3d/2tdNbMmCsGzxGzzEZb68Q7JgaSn86yw=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: b64d8632-4ec5-4d3a-f711-08d99fb1bc8c X-MS-Exchange-CrossTenant-AuthSource: CO1PR11MB5012.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Nov 2021 16:39:57.2810 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 4VLlilMx060R0Uh7CZDEDh0E7nxMRoPPWFGJUdQNqHnFkSsygmDUpG/50J8Eb9tC+gCc0XXD2tL8kYr7x28e13F/m8ANHEaCRHuvBiDEy/o= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1726 X-OriginatorOrg: intel.com X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org Hello, On 04/11/2021 15:46, Kinsella, Ray wrote: > I would guess it - I would say it is related to cache alignment. > Assuming each entry is 8 bytes 😊 > > Ray K > >> -----Original Message----- >> From: Thomas Monjalon >> Sent: Thursday 4 November 2021 14:12 >> To: Syam Prasad N Pearson >> Cc: users@dpdk.org; dev@dpdk.org; Wang, Yipeng1 >> ; Gobriel, Sameh ; >> Richardson, Bruce ; Medvedkin, Vladimir >> >> Subject: Re: [dpdk-dev] Doubt regarding DPDK hash Library >> implementation >> >> +Cc hash lib maintainers >> >> 01/11/2021 11:55, Syam Prasad N Pearson: >>> Dear Sir/Madam, >>> I am a developer trying to get familiar with the DPDK hash library. >> I >>> tried to make and use a hash table successfully. >>> During the development I came across a variable >>> >>> /** 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. >>> I am using DPDK 20.11.3 LTS. >>> >>> Please help. >> >> > -- Regards, Vladimir