* [dpdk-dev] [PATCH] hash: fix incorrect free slot check
@ 2016-10-04 7:16 Pablo de Lara
2016-10-04 9:34 ` Bruce Richardson
0 siblings, 1 reply; 3+ messages in thread
From: Pablo de Lara @ 2016-10-04 7:16 UTC (permalink / raw)
To: dev; +Cc: bruce.richardson, Pablo de Lara
In function rte_hash_cuckoo_insert_mw_tm, while looking for
an empty slot, only the first entry in the bucket was being checked,
as key_idx array was not being iterated.
Fixes: 5fc74c2e146d ("hash: check if slot is empty with key index")
Reported-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
lib/librte_hash/rte_cuckoo_hash_x86.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/librte_hash/rte_cuckoo_hash_x86.h b/lib/librte_hash/rte_cuckoo_hash_x86.h
index e16d69c..7ffa56f 100644
--- a/lib/librte_hash/rte_cuckoo_hash_x86.h
+++ b/lib/librte_hash/rte_cuckoo_hash_x86.h
@@ -53,7 +53,7 @@ rte_hash_cuckoo_insert_mw_tm(struct rte_hash_bucket *prim_bkt,
*/
for (i = 0; i < RTE_HASH_BUCKET_ENTRIES; i++) {
/* Check if slot is available */
- if (likely(prim_bkt->key_idx == EMPTY_SLOT)) {
+ if (likely(prim_bkt->key_idx[i] == EMPTY_SLOT)) {
prim_bkt->signatures[i].current = sig;
prim_bkt->signatures[i].alt = alt_hash;
prim_bkt->key_idx[i] = new_idx;
--
2.7.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH] hash: fix incorrect free slot check
2016-10-04 7:16 [dpdk-dev] [PATCH] hash: fix incorrect free slot check Pablo de Lara
@ 2016-10-04 9:34 ` Bruce Richardson
2016-10-04 9:41 ` Thomas Monjalon
0 siblings, 1 reply; 3+ messages in thread
From: Bruce Richardson @ 2016-10-04 9:34 UTC (permalink / raw)
To: Pablo de Lara; +Cc: dev
On Tue, Oct 04, 2016 at 08:16:34AM +0100, Pablo de Lara wrote:
> In function rte_hash_cuckoo_insert_mw_tm, while looking for
> an empty slot, only the first entry in the bucket was being checked,
> as key_idx array was not being iterated.
>
> Fixes: 5fc74c2e146d ("hash: check if slot is empty with key index")
>
> Reported-by: Bruce Richardson <bruce.richardson@intel.com>
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH] hash: fix incorrect free slot check
2016-10-04 9:34 ` Bruce Richardson
@ 2016-10-04 9:41 ` Thomas Monjalon
0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2016-10-04 9:41 UTC (permalink / raw)
To: Pablo de Lara; +Cc: dev, Bruce Richardson
2016-10-04 10:34, Bruce Richardson:
> On Tue, Oct 04, 2016 at 08:16:34AM +0100, Pablo de Lara wrote:
> > In function rte_hash_cuckoo_insert_mw_tm, while looking for
> > an empty slot, only the first entry in the bucket was being checked,
> > as key_idx array was not being iterated.
> >
> > Fixes: 5fc74c2e146d ("hash: check if slot is empty with key index")
> >
> > Reported-by: Bruce Richardson <bruce.richardson@intel.com>
> > Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Applied, thanks
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-10-04 9:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-04 7:16 [dpdk-dev] [PATCH] hash: fix incorrect free slot check Pablo de Lara
2016-10-04 9:34 ` Bruce Richardson
2016-10-04 9:41 ` Thomas Monjalon
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).