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 C5AB31B526 for ; Fri, 23 Nov 2018 11:30:49 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 353693082E02; Fri, 23 Nov 2018 10:30:49 +0000 (UTC) Received: from ktraynor.remote.csb (unknown [10.36.118.7]) by smtp.corp.redhat.com (Postfix) with ESMTP id B43116128A; Fri, 23 Nov 2018 10:30:47 +0000 (UTC) From: Kevin Traynor To: Yipeng Wang Cc: Bruce Richardson , dpdk stable Date: Fri, 23 Nov 2018 10:27:07 +0000 Message-Id: <20181123102713.17309-63-ktraynor@redhat.com> In-Reply-To: <20181123102713.17309-1-ktraynor@redhat.com> References: <20181123102713.17309-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Fri, 23 Nov 2018 10:30:49 +0000 (UTC) Subject: [dpdk-stable] patch 'hash: fix TSX aborts with newer gcc' 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: Fri, 23 Nov 2018 10:30:50 -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/29/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 88779d06afa7a00ded5d9e4c569147ca0683e481 Mon Sep 17 00:00:00 2001 From: Yipeng Wang Date: Mon, 12 Nov 2018 10:47:16 +0000 Subject: [PATCH] hash: fix TSX aborts with newer gcc [ upstream commit 606bd11736a210aa79fe5da4ea0cb3a9cbcde4a0 ] gcc 7 and 8 with O3 will generate vzeroupper from rte_memcpy into TSX region which may abort the TSX transaction. This fix changes rte_memcpy to memcpy which will not insert extra vzeroupper into the library. Fixes: f2e3001b53ec ("hash: support read/write concurrency") Signed-off-by: Yipeng Wang Signed-off-by: Bruce Richardson --- lib/librte_hash/rte_cmp_x86.h | 2 ++ lib/librte_hash/rte_cuckoo_hash.c | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/librte_hash/rte_cmp_x86.h b/lib/librte_hash/rte_cmp_x86.h index e82b4c089..13a583635 100644 --- a/lib/librte_hash/rte_cmp_x86.h +++ b/lib/librte_hash/rte_cmp_x86.h @@ -3,4 +3,6 @@ */ +#include + /* Functions to compare multiple of 16 byte keys (up to 128 bytes) */ static int diff --git a/lib/librte_hash/rte_cuckoo_hash.c b/lib/librte_hash/rte_cuckoo_hash.c index 9a99a415e..be75e66ed 100644 --- a/lib/librte_hash/rte_cuckoo_hash.c +++ b/lib/librte_hash/rte_cuckoo_hash.c @@ -13,5 +13,4 @@ #include /* for definition of RTE_CACHE_LINE_SIZE */ #include -#include #include #include @@ -777,5 +776,5 @@ __rte_hash_add_key_with_hash(const struct rte_hash *h, const void *key, new_idx = (uint32_t)((uintptr_t) slot_id); /* Copy key */ - rte_memcpy(new_k->key, key, h->key_len); + memcpy(new_k->key, key, h->key_len); new_k->pdata = data; -- 2.19.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2018-11-23 10:22:55.875430016 +0000 +++ 0063-hash-fix-TSX-aborts-with-newer-gcc.patch 2018-11-23 10:22:54.000000000 +0000 @@ -1,8 +1,10 @@ -From 606bd11736a210aa79fe5da4ea0cb3a9cbcde4a0 Mon Sep 17 00:00:00 2001 +From 88779d06afa7a00ded5d9e4c569147ca0683e481 Mon Sep 17 00:00:00 2001 From: Yipeng Wang Date: Mon, 12 Nov 2018 10:47:16 +0000 Subject: [PATCH] hash: fix TSX aborts with newer gcc +[ upstream commit 606bd11736a210aa79fe5da4ea0cb3a9cbcde4a0 ] + gcc 7 and 8 with O3 will generate vzeroupper from rte_memcpy into TSX region which may abort the TSX transaction. @@ -10,7 +12,6 @@ extra vzeroupper into the library. Fixes: f2e3001b53ec ("hash: support read/write concurrency") -Cc: stable@dpdk.org Signed-off-by: Yipeng Wang Signed-off-by: Bruce Richardson @@ -31,22 +32,22 @@ /* Functions to compare multiple of 16 byte keys (up to 128 bytes) */ static int diff --git a/lib/librte_hash/rte_cuckoo_hash.c b/lib/librte_hash/rte_cuckoo_hash.c -index e68bf336b..c55a4f263 100644 +index 9a99a415e..be75e66ed 100644 --- a/lib/librte_hash/rte_cuckoo_hash.c +++ b/lib/librte_hash/rte_cuckoo_hash.c -@@ -14,5 +14,4 @@ +@@ -13,5 +13,4 @@ #include /* for definition of RTE_CACHE_LINE_SIZE */ #include -#include #include #include -@@ -983,5 +982,5 @@ __rte_hash_add_key_with_hash(const struct rte_hash *h, const void *key, +@@ -777,5 +776,5 @@ __rte_hash_add_key_with_hash(const struct rte_hash *h, const void *key, new_idx = (uint32_t)((uintptr_t) slot_id); /* Copy key */ - rte_memcpy(new_k->key, key, h->key_len); + memcpy(new_k->key, key, h->key_len); - /* Key can be of arbitrary length, so it is not possible to store - * it atomically. Hence the new key element's memory stores + new_k->pdata = data; + -- 2.19.0