From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.mhcomputing.net (master.mhcomputing.net [74.208.46.186]) by dpdk.org (Postfix) with ESMTP id C2B38E72 for ; Thu, 2 Jul 2015 18:30:09 +0200 (CEST) Received: from [192.168.1.160] (99-34-229-174.lightspeed.sntcca.sbcglobal.net [99.34.229.174]) by mail.mhcomputing.net (Postfix) with ESMTPSA id B37E680C502; Thu, 2 Jul 2015 09:27:22 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) From: Matthew Hall In-Reply-To: <3EB4FA525960D640B5BDFFD6A3D89126323949C2@IRSMSX108.ger.corp.intel.com> Date: Thu, 2 Jul 2015 09:30:05 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <23903483D1A9B04AB5D759C6C845237F042C1A2EA7@ONWVEXCHMB05.ciena.com> <20150702093611.GB7688@bricha3-MOBL3> <3EB4FA525960D640B5BDFFD6A3D89126323949C2@IRSMSX108.ger.corp.intel.com> To: "Abdul, Jaffar" , "dev@dpdk.org" X-Mailer: Apple Mail (2.1878.6) Subject: Re: [dpdk-dev] DPDK Hash library X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 16:30:10 -0000 On Jul 2, 2015, at 4:20 AM, Dumitrescu, Cristian = wrote: > I am wondering how can I use the hash library if I don't know the = number > of entries in the bucket (number of entries in the bucket can grow > dynamically) > I am trying to use the DPDK hash library for MAC table where I can't = give > the fixed number of elements in each bucket. Another thing to keep in mind. DPDK hashes have an extremely large = number of shallow buckets and pretty good spreading hash functions, This = is for performance reasons to minimize the amount of cacheline loads. = The chances of evicting buckets in this sort of hash table aren't really = all that high so worrying about this might be overkill. If you want a good quality hash table for weird stuff like = variable-length keys, deeper buckets to guarantee items are preserved, = etc., what I ended up doing was combining uthash with jemalloc in my app = (you could also use rte_malloc but I didn't want to complicate the app = too much until I get it feature complete and begin tuning it). https://troydhanson.github.io/uthash/ https://github.com/troydhanson/uthash http://www.canonware.com/jemalloc/ https://github.com/jemalloc/jemalloc Matthew.=