[dpdk-stable] patch 'hash: fix key store element alignment' has been queued to stable release 18.08.1

Kevin Traynor ktraynor at redhat.com
Thu Nov 22 17:49:27 CET 2018


Hi,

FYI, your patch has been queued to stable release 18.08.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/28/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.

Kevin Traynor

---
>From d5ed694189863035aef1b16ff24c12b732fd94d8 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 da8ddf40a..0c9df35d3 100644
--- a/lib/librte_hash/rte_cuckoo_hash.c
+++ b/lib/librte_hash/rte_cuckoo_hash.c
@@ -190,5 +190,7 @@ rte_hash_create(const struct rte_hash_parameters *params)
 	}
 
-	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;
 
diff --git a/lib/librte_hash/rte_cuckoo_hash.h b/lib/librte_hash/rte_cuckoo_hash.h
index fc0e5c262..f486d90b3 100644
--- a/lib/librte_hash/rte_cuckoo_hash.h
+++ b/lib/librte_hash/rte_cuckoo_hash.h
@@ -124,5 +124,5 @@ struct rte_hash_key {
 	/* Variable key size */
 	char key[0];
-} __attribute__((aligned(KEY_ALIGNMENT)));
+};
 
 /* All different signature compare functions */
-- 
2.19.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2018-11-22 16:47:33.162930338 +0000
+++ 0035-hash-fix-key-store-element-alignment.patch	2018-11-22 16:47:32.000000000 +0000
@@ -1,15 +1,16 @@
-From dbdbc4a2e9c4b67247ef2f6556debe7522b5d2e4 Mon Sep 17 00:00:00 2001
+From d5ed694189863035aef1b16ff24c12b732fd94d8 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,10 +24,10 @@
  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 da8ddf40a..0c9df35d3 100644
 --- a/lib/librte_hash/rte_cuckoo_hash.c
 +++ b/lib/librte_hash/rte_cuckoo_hash.c
-@@ -280,5 +280,7 @@ rte_hash_create(const struct rte_hash_parameters *params)
+@@ -190,5 +190,7 @@ rte_hash_create(const struct rte_hash_parameters *params)
  	}
  
 -	const uint32_t key_entry_size = sizeof(struct rte_hash_key) + params->key_len;
@@ -36,7 +37,7 @@
  	const uint64_t key_tbl_size = (uint64_t) key_entry_size * num_key_slots;
  
 diff --git a/lib/librte_hash/rte_cuckoo_hash.h b/lib/librte_hash/rte_cuckoo_hash.h
-index ff9518184..601b2ce78 100644
+index fc0e5c262..f486d90b3 100644
 --- a/lib/librte_hash/rte_cuckoo_hash.h
 +++ b/lib/librte_hash/rte_cuckoo_hash.h
 @@ -124,5 +124,5 @@ struct rte_hash_key {


More information about the stable mailing list