From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <thomas.monjalon@6wind.com>
Received: from mail-wm0-f45.google.com (mail-wm0-f45.google.com [74.125.82.45])
 by dpdk.org (Postfix) with ESMTP id 15F0BDE0
 for <users@dpdk.org>; Tue, 14 Feb 2017 15:26:47 +0100 (CET)
Received: by mail-wm0-f45.google.com with SMTP id v186so19149093wmd.0
 for <users@dpdk.org>; Tue, 14 Feb 2017 06:26:47 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=6wind-com.20150623.gappssmtp.com; s=20150623;
 h=from:to:cc:subject:date:message-id:user-agent:in-reply-to
 :references:mime-version:content-transfer-encoding;
 bh=sKvWJDDr6QJPncyB9PEatNJPI4q7z3cHYSSdXgAsG8M=;
 b=MgQPOKU3OPEhEMzF/SaLWfLjBnFnYhkFhvZeAc43vUZyU62tRbaAzD9RamApvoJpgf
 WU9h61P9TCYnlwJteCnZ9Xp4N7nFsp1+HbjEScPaNEsTLX+6RWYfn0ayOuUINcoKjwF2
 0i0fuFfHbklMZm1AkrDxIEUsbL06Pq5dDuMAMQUt477rhNdoVZrIJFminFJKy50Yj+/v
 wvXnKOQWKnvVXMUzbgOI9tC8GLpXR18LrSH3E0XkdXDgSfq/PJGwQLCOZBs4psNvdczP
 ONtxLalGkfQM2PsY1oNykSh8bDkMAlzP0MBva4iK6QxlrWdsP3jDgos8PYP6YLvTTtzt
 fTzA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent
 :in-reply-to:references:mime-version:content-transfer-encoding;
 bh=sKvWJDDr6QJPncyB9PEatNJPI4q7z3cHYSSdXgAsG8M=;
 b=GPo456ctNYFes/42RNWnq+MIUCCZERlSCx70ETgJClt47AEh487yCDbz8al449Wfs5
 peGcAqw9yC1mzL+avuisFdkD8+k3EV2B0LyHbZ/JFFu5DL4ia4PRvI1ztAgsk35qdNVW
 wEhFLaCRlNGLjVj7GuLp2fmy6kqrN01CCCg91xRDCJ3lnTNNiZtfLFdWkRdCgRM3CAOm
 fRyykK0Tq/z7aJw6h1RHOACQwBv6jZ3LKNVWevy7/lSySwFb6mc2+WMi/F68AoPF9GyF
 /wKubuz57LQyO5eLFT7v9Qyp0sYw7dHMN8c6TSicV+QE3ebYBwDGRPa7ORBIOsdQ1e+0
 W+sA==
X-Gm-Message-State: AMke39lch76Vzr43bGhn1xXXxpAx610LTMT8oP9Pqw3EU97jBXAHM0Fdb/6SlH4ZM0fflhPQ
X-Received: by 10.28.150.202 with SMTP id y193mr3701300wmd.106.1487082406815; 
 Tue, 14 Feb 2017 06:26:46 -0800 (PST)
Received: from xps13.localnet (184.203.134.77.rev.sfr.net. [77.134.203.184])
 by smtp.gmail.com with ESMTPSA id p62sm1476930wmb.25.2017.02.14.06.26.45
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Tue, 14 Feb 2017 06:26:46 -0800 (PST)
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: "De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>
Cc: users@dpdk.org, Rob Zimmerman <rob@thezims.net>
Date: Tue, 14 Feb 2017 15:26:45 +0100
Message-ID: <2559373.u8yrGXqafe@xps13>
User-Agent: KMail/4.14.10 (Linux/4.5.4-1-ARCH; KDE/4.14.11; x86_64; ; )
In-Reply-To: <E115CCD9D858EF4F90C690B0DCB4D897476DA027@IRSMSX108.ger.corp.intel.com>
References: <CAG0K5qvb_pV7Z8N=gNw+JiSjvq3CfF=t1EALhHaJ_PxSTGKE5Q@mail.gmail.com>
 <E115CCD9D858EF4F90C690B0DCB4D897476DA027@IRSMSX108.ger.corp.intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
Subject: Re: [dpdk-users] Is Elastic Flow Distributor thread-safe?
X-BeenThere: users@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK usage discussions <users.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/users>,
 <mailto:users-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/users/>
List-Post: <mailto:users@dpdk.org>
List-Help: <mailto:users-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/users>,
 <mailto:users-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Tue, 14 Feb 2017 14:26:47 -0000

2017-02-14 14:14, De Lara Guarch, Pablo:
> From: Rob
> >   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.

Should it be added to the documentation?