From: "De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>
To: "Richardson, Bruce" <bruce.richardson@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, "stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-stable] [PATCH] hash: fix incorrect eviction counter
Date: Fri, 22 Sep 2017 10:40:33 +0000 [thread overview]
Message-ID: <E115CCD9D858EF4F90C690B0DCB4D8976CC21F19@IRSMSX108.ger.corp.intel.com> (raw)
In-Reply-To: <20170922083557.GB10104@bricha3-MOBL3.ger.corp.intel.com>
> -----Original Message-----
> From: Richardson, Bruce
> Sent: Friday, September 22, 2017 9:36 AM
> To: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
> Cc: dev@dpdk.org; stable@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@dpdk.org
> >
> > Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@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
next prev parent reply other threads:[~2017-09-22 10:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-21 12:46 Pablo de Lara
2017-09-22 4:25 ` [dpdk-stable] [PATCH v2] " Pablo de Lara
2017-09-22 13:46 ` Bruce Richardson
2017-10-06 22:10 ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon
2017-09-22 8:35 ` [dpdk-stable] [PATCH] " Bruce Richardson
2017-09-22 10:40 ` De Lara Guarch, Pablo [this message]
-- strict thread matches above, loose matches on Subject: below --
2017-09-21 5:37 Pablo de Lara
2017-09-21 20:45 ` De Lara Guarch, Pablo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E115CCD9D858EF4F90C690B0DCB4D8976CC21F19@IRSMSX108.ger.corp.intel.com \
--to=pablo.de.lara.guarch@intel.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).