patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Cc: dev@dpdk.org, stable@dpdk.org
Subject: Re: [dpdk-stable] [PATCH] hash: fix incorrect eviction counter
Date: Fri, 22 Sep 2017 09:35:57 +0100	[thread overview]
Message-ID: <20170922083557.GB10104@bricha3-MOBL3.ger.corp.intel.com> (raw)
In-Reply-To: <20170921124646.68253-1-pablo.de.lara.guarch@intel.com>

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

  parent reply	other threads:[~2017-09-22  8:36 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 ` Bruce Richardson [this message]
2017-09-22 10:40   ` [dpdk-stable] [PATCH] " De Lara Guarch, Pablo
  -- 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=20170922083557.GB10104@bricha3-MOBL3.ger.corp.intel.com \
    --to=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=pablo.de.lara.guarch@intel.com \
    --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).