From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 9663D968; Fri, 22 Sep 2017 10:36:01 +0200 (CEST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Sep 2017 01:36:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,427,1500966000"; d="scan'208";a="131290505" Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.221.24]) by orsmga004.jf.intel.com with SMTP; 22 Sep 2017 01:35:58 -0700 Received: by (sSMTP sendmail emulation); Fri, 22 Sep 2017 09:35:57 +0100 Date: Fri, 22 Sep 2017 09:35:57 +0100 From: Bruce Richardson To: Pablo de Lara Cc: dev@dpdk.org, stable@dpdk.org Message-ID: <20170922083557.GB10104@bricha3-MOBL3.ger.corp.intel.com> References: <20170921124646.68253-1-pablo.de.lara.guarch@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170921124646.68253-1-pablo.de.lara.guarch@intel.com> Organization: Intel Research and Development Ireland Ltd. User-Agent: Mutt/1.8.3 (2017-05-23) 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 08:36:02 -0000 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 function calls as parameter, and it gets reset to zero at the start, do you even need an array. Can you not just have a non-static local variable in the function? /Bruce