[dpdk-stable] patch 'hash: fix key store element alignment' has been queued to LTS release 16.11.9
Luca Boccassi
bluca at debian.org
Mon Oct 29 13:53:15 CET 2018
Hi,
FYI, your patch has been queued to LTS release 16.11.9
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 10/31/18. So please
shout if anyone has objections.
Also note that after the patch there's a diff of the upstream commit vs the patch applied
to the branch. If the code is different (ie: not only metadata diffs), due for example to
a change in context or macro names, please double check it.
Thanks.
Luca Boccassi
---
>From 92e21e2bfb1b8dacc4aeb19514090ccb194bff60 Mon Sep 17 00:00:00 2001
From: Honnappa Nagarahalli <honnappa.nagarahalli at arm.com>
Date: Fri, 26 Oct 2018 00:37:31 -0500
Subject: [PATCH] hash: fix key store element alignment
[ upstream commit dbdbc4a2e9c4b67247ef2f6556debe7522b5d2e4 ]
Fix the key store array element alignment such that every array
element is aligned on KEY_ALIGNMENT boundary. This is required to
make 'pdata' in 'struct rte_hash_key' align on its natural boundary
for atomic load/store.
Fixes: 473d1bebce43 ("hash: allow to store data in hash table")
Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli at arm.com>
Reviewed-by: Gavin Hu <gavin.hu at arm.com>
Reviewed-by: Ola Liljedahl <ola.liljedahl at arm.com>
Reviewed-by: Steve Capper <steve.capper at arm.com>
Reviewed-by: Yipeng Wang <yipeng1.wang at intel.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
---
lib/librte_hash/rte_cuckoo_hash.c | 4 +++-
lib/librte_hash/rte_cuckoo_hash.h | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/librte_hash/rte_cuckoo_hash.c b/lib/librte_hash/rte_cuckoo_hash.c
index 049ff9884..5aaa6ccd0 100644
--- a/lib/librte_hash/rte_cuckoo_hash.c
+++ b/lib/librte_hash/rte_cuckoo_hash.c
@@ -212,7 +212,9 @@ rte_hash_create(const struct rte_hash_parameters *params)
goto err_unlock;
}
- const uint32_t key_entry_size = sizeof(struct rte_hash_key) + params->key_len;
+ const uint32_t key_entry_size =
+ RTE_ALIGN(sizeof(struct rte_hash_key) + params->key_len,
+ KEY_ALIGNMENT);
const uint64_t key_tbl_size = (uint64_t) key_entry_size * num_key_slots;
k = rte_zmalloc_socket(NULL, key_tbl_size,
diff --git a/lib/librte_hash/rte_cuckoo_hash.h b/lib/librte_hash/rte_cuckoo_hash.h
index 1b8ffed8e..dae3f4a3c 100644
--- a/lib/librte_hash/rte_cuckoo_hash.h
+++ b/lib/librte_hash/rte_cuckoo_hash.h
@@ -161,7 +161,7 @@ struct rte_hash_key {
};
/* Variable key size */
char key[0];
-} __attribute__((aligned(KEY_ALIGNMENT)));
+};
/* All different signature compare functions */
enum rte_hash_sig_compare_function {
--
2.19.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2018-10-29 12:48:14.585131127 +0000
+++ 0006-hash-fix-key-store-element-alignment.patch 2018-10-29 12:48:14.438417982 +0000
@@ -1,15 +1,16 @@
-From dbdbc4a2e9c4b67247ef2f6556debe7522b5d2e4 Mon Sep 17 00:00:00 2001
+From 92e21e2bfb1b8dacc4aeb19514090ccb194bff60 Mon Sep 17 00:00:00 2001
From: Honnappa Nagarahalli <honnappa.nagarahalli at arm.com>
Date: Fri, 26 Oct 2018 00:37:31 -0500
Subject: [PATCH] hash: fix key store element alignment
+[ upstream commit dbdbc4a2e9c4b67247ef2f6556debe7522b5d2e4 ]
+
Fix the key store array element alignment such that every array
element is aligned on KEY_ALIGNMENT boundary. This is required to
make 'pdata' in 'struct rte_hash_key' align on its natural boundary
for atomic load/store.
Fixes: 473d1bebce43 ("hash: allow to store data in hash table")
-Cc: stable at dpdk.org
Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli at arm.com>
Reviewed-by: Gavin Hu <gavin.hu at arm.com>
@@ -23,11 +24,11 @@
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/librte_hash/rte_cuckoo_hash.c b/lib/librte_hash/rte_cuckoo_hash.c
-index e08739370..d79ba68fd 100644
+index 049ff9884..5aaa6ccd0 100644
--- a/lib/librte_hash/rte_cuckoo_hash.c
+++ b/lib/librte_hash/rte_cuckoo_hash.c
-@@ -279,7 +279,9 @@ rte_hash_create(const struct rte_hash_parameters *params)
- rte_ring_sp_enqueue(r_ext, (void *)((uintptr_t) i));
+@@ -212,7 +212,9 @@ rte_hash_create(const struct rte_hash_parameters *params)
+ goto err_unlock;
}
- const uint32_t key_entry_size = sizeof(struct rte_hash_key) + params->key_len;
@@ -38,10 +39,10 @@
k = rte_zmalloc_socket(NULL, key_tbl_size,
diff --git a/lib/librte_hash/rte_cuckoo_hash.h b/lib/librte_hash/rte_cuckoo_hash.h
-index ff9518184..601b2ce78 100644
+index 1b8ffed8e..dae3f4a3c 100644
--- a/lib/librte_hash/rte_cuckoo_hash.h
+++ b/lib/librte_hash/rte_cuckoo_hash.h
-@@ -123,7 +123,7 @@ struct rte_hash_key {
+@@ -161,7 +161,7 @@ struct rte_hash_key {
};
/* Variable key size */
char key[0];
More information about the stable
mailing list