From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 232AA7CDE; Fri, 22 Sep 2017 12:40:36 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Sep 2017 03:40:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,427,1500966000"; d="scan'208";a="902870867" Received: from irsmsx101.ger.corp.intel.com ([163.33.3.153]) by FMSMGA003.fm.intel.com with ESMTP; 22 Sep 2017 03:40:35 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.167]) by IRSMSX101.ger.corp.intel.com ([169.254.1.22]) with mapi id 14.03.0319.002; Fri, 22 Sep 2017 11:40:34 +0100 From: "De Lara Guarch, Pablo" To: "Richardson, Bruce" CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH] hash: fix incorrect eviction counter Thread-Index: AQHTMxq8CQ2bJQBv00OBHP2ni7bzMaLAhKaAgAAzXkA= Date: Fri, 22 Sep 2017 10:40:33 +0000 Message-ID: References: <20170921124646.68253-1-pablo.de.lara.guarch@intel.com> <20170922083557.GB10104@bricha3-MOBL3.ger.corp.intel.com> In-Reply-To: <20170922083557.GB10104@bricha3-MOBL3.ger.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNTNkZjcyNWQtNzEyZC00N2EyLWExNmYtNmI3ZGQ3Njc0OTg4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IlBYTVpBM2JGXC9BTU9BTEtORzVLY2MrdXpUVGdWTTk4VTBQNmttOVQrRlNnPSJ9 x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-stable] [PATCH] hash: fix incorrect eviction counter X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Sep 2017 10:40:37 -0000 > -----Original Message----- > From: Richardson, Bruce > Sent: Friday, September 22, 2017 9:36 AM > To: De Lara Guarch, Pablo > Cc: dev@dpdk.org; stable@dpdk.org > Subject: Re: [PATCH] hash: fix incorrect eviction counter >=20 > On Thu, Sep 21, 2017 at 01:46:46PM +0100, Pablo de Lara wrote: > > When adding a new entry in a hash table, there is a maximum number of > > evictions that can be performed. When the counter of these evictions > > reaches this maximum, the entry cannot be added, as it is considered > > that the algorithm has encountered an infinite loop. > > > > The problem with the current implementation, is that this counter was > > declared as a static variable. > > If there are multiple threads adding entries in the same table or in > > different tables, they should access different counters, one per core > > and per table. > > > > Therefore, an array of counter has been added to the hash table > > structure. > > > > Fixes: 243e93a5046f ("hash: fix unlimited cuckoo path") > > Cc: stable@dpdk.org > > > > Signed-off-by: Pablo de Lara > > --- > Since you appear to be passing this counter through the different functio= n > calls as parameter, and it gets reset to zero at the start, do you even n= eed > an array. Can you not just have a non-static local variable in the functi= on? >=20 > /Bruce Right, I clearly overthought here... Will send a v2 with your much simpler = approach. Thanks! Pablo