[dpdk-dev] [PATCH] hash: fix incorrect eviction counter

De Lara Guarch, Pablo pablo.de.lara.guarch at intel.com
Fri Sep 22 12:40:33 CEST 2017



> -----Original Message-----
> From: Richardson, Bruce
> Sent: Friday, September 22, 2017 9:36 AM
> To: De Lara Guarch, Pablo <pablo.de.lara.guarch at intel.com>
> Cc: dev at dpdk.org; stable at dpdk.org
> Subject: Re: [PATCH] hash: fix incorrect eviction counter
> 
> 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 at dpdk.org
> >
> > Signed-off-by: Pablo de Lara <pablo.de.lara.guarch at intel.com>
> > ---
> 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

Right, I clearly overthought here... Will send a v2 with your much simpler approach.

Thanks!
Pablo


More information about the dev mailing list