All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hash: fix ring size
@ 2016-09-26 23:51 Pablo de Lara
  2016-09-27 21:58 ` De Lara Guarch, Pablo
  0 siblings, 1 reply; 2+ messages in thread
From: Pablo de Lara @ 2016-09-26 23:51 UTC (permalink / raw)
  To: dev; +Cc: bruce.richardson, Pablo de Lara

Ring stores the free slots available to be used in the key table.
The ring size was being increased by 1, because of the dummy slot,
used for key misses, but this is not actually stored in the ring,
so there is no need to increase it.

Fixes: 5915699153d7 ("hash: fix scaling by reducing contention")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 lib/librte_hash/rte_cuckoo_hash.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/librte_hash/rte_cuckoo_hash.c b/lib/librte_hash/rte_cuckoo_hash.c
index 2e6429f..69fd663 100644
--- a/lib/librte_hash/rte_cuckoo_hash.c
+++ b/lib/librte_hash/rte_cuckoo_hash.c
@@ -160,7 +160,8 @@ rte_hash_create(const struct rte_hash_parameters *params)
 		num_key_slots = params->entries + 1;
 
 	snprintf(ring_name, sizeof(ring_name), "HT_%s", params->name);
-	r = rte_ring_create(ring_name, rte_align32pow2(num_key_slots),
+	/* Create ring (Dummy slot index is not enqueued) */
+	r = rte_ring_create(ring_name, rte_align32pow2(num_key_slots - 1),
 			params->socket_id, 0);
 	if (r == NULL) {
 		RTE_LOG(ERR, HASH, "memory allocation failed\n");
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] hash: fix ring size
  2016-09-26 23:51 [PATCH] hash: fix ring size Pablo de Lara
@ 2016-09-27 21:58 ` De Lara Guarch, Pablo
  0 siblings, 0 replies; 2+ messages in thread
From: De Lara Guarch, Pablo @ 2016-09-27 21:58 UTC (permalink / raw)
  To: dev; +Cc: Richardson, Bruce



> -----Original Message-----
> From: De Lara Guarch, Pablo
> Sent: Monday, September 26, 2016 4:52 PM
> To: dev@dpdk.org
> Cc: Richardson, Bruce; De Lara Guarch, Pablo
> Subject: [PATCH] hash: fix ring size
> 
> Ring stores the free slots available to be used in the key table.
> The ring size was being increased by 1, because of the dummy slot,
> used for key misses, but this is not actually stored in the ring,
> so there is no need to increase it.
> 
> Fixes: 5915699153d7 ("hash: fix scaling by reducing contention")
> 
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

Nack. This was already sent in another patchset

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-09-27 21:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-26 23:51 [PATCH] hash: fix ring size Pablo de Lara
2016-09-27 21:58 ` De Lara Guarch, Pablo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.