From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id AB4371B488 for ; Thu, 22 Nov 2018 17:52:29 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0CE219D789; Thu, 22 Nov 2018 16:52:29 +0000 (UTC) Received: from ktraynor.remote.csb (unknown [10.36.118.7]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9874760FD9; Thu, 22 Nov 2018 16:52:26 +0000 (UTC) From: Kevin Traynor To: Honnappa Nagarahalli Cc: Gavin Hu , Ola Liljedahl , Steve Capper , Yipeng Wang , Bruce Richardson , dpdk stable Date: Thu, 22 Nov 2018 16:49:27 +0000 Message-Id: <20181122164957.13003-35-ktraynor@redhat.com> In-Reply-To: <20181122164957.13003-1-ktraynor@redhat.com> References: <20181122164957.13003-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 22 Nov 2018 16:52:29 +0000 (UTC) Subject: [dpdk-stable] patch 'hash: fix key store element alignment' has been queued to stable release 18.08.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 16:52:30 -0000 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 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 Reviewed-by: Gavin Hu Reviewed-by: Ola Liljedahl Reviewed-by: Steve Capper Reviewed-by: Yipeng Wang Acked-by: Bruce Richardson --- 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 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@dpdk.org Signed-off-by: Honnappa Nagarahalli Reviewed-by: Gavin Hu @@ -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 {