[dpdk-stable] patch 'hash: fix multiwriter lock memory allocation' has been queued to LTS release 17.11.4
Yongseok Koh
yskoh at mellanox.com
Fri Jul 27 04:27:40 CEST 2018
Hi,
FYI, your patch has been queued to LTS release 17.11.4
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/28/18. So please
shout if anyone has objections.
Thanks.
Yongseok
---
>From f0e6f88b0975443aa72cedf233fbe002c8aaf733 Mon Sep 17 00:00:00 2001
From: Yipeng Wang <yipeng1.wang at intel.com>
Date: Tue, 10 Jul 2018 09:59:54 -0700
Subject: [PATCH] hash: fix multiwriter lock memory allocation
[ upstream commit 27c813679ea961b94d3184c09e50a055ad726da3 ]
When malloc for multiwriter_lock, the align should be
RTE_CACHE_LINE_SIZE rather than LCORE_CACHE_SIZE.
Also there should be check to verify the success of
rte_malloc.
Fixes: be856325cba3 ("hash: add scalable multi-writer insertion with Intel TSX")
Signed-off-by: Yipeng Wang <yipeng1.wang at intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch at intel.com>
---
lib/librte_hash/rte_cuckoo_hash.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/librte_hash/rte_cuckoo_hash.c b/lib/librte_hash/rte_cuckoo_hash.c
index cbf78fab2..bc7a9d998 100644
--- a/lib/librte_hash/rte_cuckoo_hash.c
+++ b/lib/librte_hash/rte_cuckoo_hash.c
@@ -302,7 +302,10 @@ rte_hash_create(const struct rte_hash_parameters *params)
h->add_key = ADD_KEY_MULTIWRITER;
h->multiwriter_lock = rte_malloc(NULL,
sizeof(rte_spinlock_t),
- LCORE_CACHE_SIZE);
+ RTE_CACHE_LINE_SIZE);
+ if (h->multiwriter_lock == NULL)
+ goto err_unlock;
+
rte_spinlock_init(h->multiwriter_lock);
}
} else
--
2.11.0
More information about the stable
mailing list