DPDK patches and discussions
 help / color / mirror / Atom feed
From: Matthew Hall <mhall@mhcomputing.net>
To: "Abdul, Jaffar" <jabdul@ciena.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] DPDK Hash library
Date: Thu, 2 Jul 2015 09:30:05 -0700	[thread overview]
Message-ID: <CBEAAE74-0250-4978-9A5D-A65C36C03AE3@mhcomputing.net> (raw)
In-Reply-To: <3EB4FA525960D640B5BDFFD6A3D89126323949C2@IRSMSX108.ger.corp.intel.com>

On Jul 2, 2015, at 4:20 AM, Dumitrescu, Cristian <cristian.dumitrescu@intel.com> 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.

  reply	other threads:[~2015-07-02 16:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-01 23:56 Abdul, Jaffar
2015-07-02  9:36 ` Bruce Richardson
2015-07-02 11:20   ` Dumitrescu, Cristian
2015-07-02 16:30     ` Matthew Hall [this message]
2015-07-02 17:37   ` Abdul, Jaffar
2015-07-02 17:55     ` De Lara Guarch, Pablo
2015-07-02 19:26       ` Matthew Hall
2015-07-02 21:02         ` Abdul, Jaffar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CBEAAE74-0250-4978-9A5D-A65C36C03AE3@mhcomputing.net \
    --to=mhall@mhcomputing.net \
    --cc=dev@dpdk.org \
    --cc=jabdul@ciena.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).