DPDK usage discussions
 help / color / mirror / Atom feed
From: "De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>
To: Rob Zimmerman <rob@thezims.net>, "users@dpdk.org" <users@dpdk.org>
Subject: Re: [dpdk-users] Is Elastic Flow Distributor thread-safe?
Date: Tue, 14 Feb 2017 14:14:53 +0000	[thread overview]
Message-ID: <E115CCD9D858EF4F90C690B0DCB4D897476DA027@IRSMSX108.ger.corp.intel.com> (raw)
In-Reply-To: <CAG0K5qvb_pV7Z8N=gNw+JiSjvq3CfF=t1EALhHaJ_PxSTGKE5Q@mail.gmail.com>

Hi Rob,

> -----Original Message-----
> From: users [mailto:users-bounces@dpdk.org] On Behalf Of Rob
> Zimmerman
> Sent: Monday, February 13, 2017 2:26 PM
> To: users@dpdk.org
> Subject: [dpdk-users] Is Elastic Flow Distributor thread-safe?
> 
> Hi Everyone,
> 
>   Playing around with EFD and seeing some really bizarre behavior in a
> multi-core environment. Is it safe for multiple logical cores to be making
> EFD table updates while another logical core is performing lookups? Side
> note: the core which is making lookups is where the offline table resides.
> 
> Intuition tells me this is probably not safe, but the docs make no mention
> of thread safety.

The library is not thread-safe. The only operation that is thread safe is the lookup.

However, although update is not thread safe, it is interesting to know the following.
Updating the EFD table consists of two steps:

1 - Compute Update: the new key is added to the offline group, which is not thread safe.
     Then, a new perfect hash for the group is computed (thread safe and where most of time is spent).

2 - Apply Update: Once the update is computed, it has to be applied to the online table (fast, but not thread safe).

Multi-writer support might be added in the future, as it was added in the Hash library.

For now, several readers can work simultaneously, as long as there is no writer working on it (you would need locks for this),
and only a single writer is supported if there is no other core doing lookups.
 
> 
> Thanks,
> -Rob

  reply	other threads:[~2017-02-14 14:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-13 14:26 Rob Zimmerman
2017-02-14 14:14 ` De Lara Guarch, Pablo [this message]
2017-02-14 14:23   ` Rob Zimmerman
2017-02-14 14:26   ` Thomas Monjalon
2017-02-14 14:38     ` De Lara Guarch, Pablo

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=E115CCD9D858EF4F90C690B0DCB4D897476DA027@IRSMSX108.ger.corp.intel.com \
    --to=pablo.de.lara.guarch@intel.com \
    --cc=rob@thezims.net \
    --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).