DPDK patches and discussions
 help / color / mirror / Atom feed
From: Helmut Sim <simhelmut@gmail.com>
To: Venkat Thummala <venkat.thummala.1978@gmail.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] using hash table in a MP environment
Date: Wed, 11 Jun 2014 08:23:34 +0300	[thread overview]
Message-ID: <CAF8yGaFJPmKzdtgviZ0QRastKorUz440U3o6DfxENh=iB4op=g@mail.gmail.com> (raw)
In-Reply-To: <CAF5bpL_TgeX5W0eaS6WbcLMhYjkjSUPEtAwSVhwecm3QOkoz6A@mail.gmail.com>

one more simple way would be to assign the desired hash function to the
hash_func in the rte_hash structure returned by rte_hash_find_existing call
at the secondary initialization phase. that way there is no difference
between a primary or a secondary process.

Regards,



On Tue, Jun 10, 2014 at 3:25 PM, Venkat Thummala <
venkat.thummala.1978@gmail.com> wrote:

> Hi Shirley,
>
> Please refer the section 20.3 [Multi-Process Limitations] in DPDK
> Programmers Guide.
>
> The use of function pointers between multiple processes running based of
> different
> compiled binaries is not supported, since the location of a given function
> in one
> process may be different to its location in a second. This prevents the
> librte_hash library from behaving properly as in a multi-threaded instance,
> since it uses a pointer to the hash function internally.
> To work around this issue, it is recommended that multi-process
> applications
> perform the hash calculations by directly calling the hashing function from
> the code
> and then using the rte_hash_add_with_hash()/
> rte_hash_lookup_with_hash() functions instead of the functions which do the
> hashing internally, such as rte_hash_add()/rte_hash_lookup()
>
> Thanks
> Venkat
>
>
> On 10 June 2014 17:05, Neil Horman <nhorman@tuxdriver.com> wrote:
>
> > On Tue, Jun 10, 2014 at 11:02:03AM +0300, Uri Sidler wrote:
> > > Hi,
> > > I am currently using a hash table in a multi-process environment.
> > > the master process creates the hash table which is later used by other
> > > secondary processes.
> > > but the secondary processes fail to use the hash table since the hash
> > > function address actually points to a different fucntion. (this makes
> > sense
> > > since the address of the hash function is in fact different per
> process).
> > > How can I solve this issue?
> > >
> > > Thanks,
> > > Shirley.
> > >
> >
> > Use shared memory.  see shmget
> >
> > Neil
> >
> >
>

  reply	other threads:[~2014-06-11  5:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-10  8:02 Uri Sidler
2014-06-10 11:35 ` Neil Horman
2014-06-10 12:25   ` Venkat Thummala
2014-06-11  5:23     ` Helmut Sim [this message]
2014-06-11 15:16       ` Richardson, Bruce

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='CAF8yGaFJPmKzdtgviZ0QRastKorUz440U3o6DfxENh=iB4op=g@mail.gmail.com' \
    --to=simhelmut@gmail.com \
    --cc=dev@dpdk.org \
    --cc=venkat.thummala.1978@gmail.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).