DPDK usage discussions
 help / color / mirror / Atom feed
From: Alex Kiselev <kiselev99@gmail.com>
To: "Fu, Qiaobin" <qiaobinf@bu.edu>
Cc: Stephen Hemminger <stephen@networkplumber.org>,
	"users@dpdk.org" <users@dpdk.org>
Subject: Re: [dpdk-users] DPDK hash table dynamic growth
Date: Mon, 17 Apr 2017 20:06:12 +0000	[thread overview]
Message-ID: <CAMKNYbz5Msda+wpgbUjW5NfjE6nd9iYaAGoEGHtvWig7FhfHgQ@mail.gmail.com> (raw)
In-Reply-To: <37C3AD58-419D-4CE9-AA23-A743B8032ECF@bu.edu>

If you need only a single reader and a single writer solution you can use
any existing hash table implementation and build on top of it your own
resizable version. You can try a straightforward approach. Create a new
bigger hash table when the old is full and just copy key/values into it. A
new reader/lookup function should take into account that during resizing
there can be more then one hash table and check all of them. And I wouldn't
copy all keys at once, but instead I'd copy N keys at one iteration of the
lcore main loop so the resizing process don't block other operations.

пн, 17 апр. 2017 г. в 20:44, Fu, Qiaobin <qiaobinf@bu.edu>:

> Thanks @Alex and @Stephen for pointing these valuable materials to me!
>
> Maybe it’s better that I can clarify my scenarios more. Actually, we are
> using RSS (source + destination IP) to distribute packets, so we are
> maintaining one hash table per lcore (thread), and there is no need for
> synchronization issue in our case. If there are more solutions, please let
> me know. I will compare the solutions, and pick up the best suitable one.
>
> Best,
> Qiaobin
>
> On Apr 17, 2017, at 1:30 PM, Alex Kiselev <kiselev99@gmail.com> wrote:
>
> I would take a look at:
>
> 1) http://preshing.com/20160201/new-concurrent-hash-maps-for-cpp/
> 2) https://github.com/efficient/libcuckoo
> 3)
>
> http://high-scale-lib.cvs.sourceforge.net/viewvc/high-scale-lib/high-scale-lib/org/cliffc/high_scale_lib/NonBlockingHashMap.java?view=markup
> https://www.youtube.com/watch?v=HJ-719EGIts
> https://www.youtube.com/watch?v=WYXgtXWejRM
>
> But there is a catch, none of them is written in C.
>
> 2017-04-17 19:54 GMT+03:00 Stephen Hemminger <stephen@networkplumber.org>:
>
> On Mon, 17 Apr 2017 15:47:59 +0000
> "Fu, Qiaobin" <qiaobinf@bu.edu> wrote:
>
> Hello,
>
> Currently, I am using the hash library to handle network flows defined as
> source and destination IP addresses. I need to find a way to alleviate
> memory pressure when the table is full. However, after some research, I
> didn’t find any hints on the dynamic growth in the hash library. Could
> anyone point me some hints on this? Thanks.
>
> Best,
> Qiaobin
>
>
> If you need growing hash table, I recommend the lock-free hash table in
> the Linux userspace RCU library;
> rather than the more limited DPDK one.
>
>
>
>
> --
> --
> Kiselev Alexander
>
>
> --
--
Kiselev Alexander

  reply	other threads:[~2017-04-17 20:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-17 15:47 Fu, Qiaobin
2017-04-17 16:54 ` Stephen Hemminger
2017-04-17 17:30   ` Alex Kiselev
2017-04-17 17:44     ` Fu, Qiaobin
2017-04-17 20:06       ` Alex Kiselev [this message]
2017-04-18  5:08         ` Shyam Shrivastav

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=CAMKNYbz5Msda+wpgbUjW5NfjE6nd9iYaAGoEGHtvWig7FhfHgQ@mail.gmail.com \
    --to=kiselev99@gmail.com \
    --cc=qiaobinf@bu.edu \
    --cc=stephen@networkplumber.org \
    --cc=users@dpdk.org \
    /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).