From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 8FBC4282 for ; Tue, 14 Feb 2017 15:38:36 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Feb 2017 06:38:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,161,1484035200"; d="scan'208";a="1126483000" Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by fmsmga002.fm.intel.com with ESMTP; 14 Feb 2017 06:38:34 -0800 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.173]) by IRSMSX103.ger.corp.intel.com ([163.33.3.157]) with mapi id 14.03.0248.002; Tue, 14 Feb 2017 14:38:23 +0000 From: "De Lara Guarch, Pablo" To: Thomas Monjalon CC: "users@dpdk.org" , Rob Zimmerman Thread-Topic: [dpdk-users] Is Elastic Flow Distributor thread-safe? Thread-Index: AQHShgVQ2vHvQ8GERkWyMANglTntRaFoVw0QgAA5pICAAAMpMA== Date: Tue, 14 Feb 2017 14:38:23 +0000 Message-ID: References: <2559373.u8yrGXqafe@xps13> In-Reply-To: <2559373.u8yrGXqafe@xps13> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiM2U2OGRjZWEtOTM1ZC00YzhjLTkwZGQtZGRkYmYzYWRjZTdjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6InhncTNvOG1JbnBOQW1tXC80Z2NQR05Mb2lJU1BqWXMzRG94UllIdWFLbEpNPSJ9 x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2017 14:38:37 -0000 > -----Original Message----- > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > Sent: Tuesday, February 14, 2017 2:27 PM > To: De Lara Guarch, Pablo > Cc: users@dpdk.org; Rob Zimmerman > Subject: Re: [dpdk-users] Is Elastic Flow Distributor thread-safe? >=20 > 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 m= aking > > > 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 an= d > 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 t= he > Hash library. > > > > For now, several readers can work simultaneously, as long as there is n= o > 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. >=20 > Should it be added to the documentation? I will send a doc patch shortly about this.