From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1B800A04DD for ; Wed, 28 Oct 2020 11:54:40 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 15F99CA37; Wed, 28 Oct 2020 11:54:39 +0100 (CET) Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by dpdk.org (Postfix) with ESMTP id 12A6FCA5A for ; Wed, 28 Oct 2020 11:54:36 +0100 (CET) Received: by mail-wr1-f67.google.com with SMTP id i1so5203216wro.1 for ; Wed, 28 Oct 2020 03:54:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cLZV79qjR1NOsmw8+KwLkljca/hs+E1KpQz2tgZkkVk=; b=McPzHAKXC6hITMXv98qD0Brf6GZfIMHLlotB1D3kxNQLm6PnE5CQtpn721Bkpn6hJK TTAqEQEl0F+VaCJ6EnABww7fe43RuCxwG5BYv9CLAh+LNd7PAryzR3cy6S1CK4ozqRkz tv5kfEPaSI2yK1Dj+OYZ5pwRIBSh0aRERUDhD7uBUW7LeXl+LiX8gBe1hEnchoLn+jT9 wKXf5TaB+yNLuKs05ltu7bP63W8vNzwruYTHE7phj+h0NDmWKsFD2Q4VupnRBgijcUGy hhOjIURuCk79DHlkgYJ40xf/J/Vq9htVDeD4smXtM5BZd4p++tM++DVeLNjllv5ViCaF mYHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cLZV79qjR1NOsmw8+KwLkljca/hs+E1KpQz2tgZkkVk=; b=WKmQZa6/Ug3k31tgPT4wnJIpvX5snOu/nh1HypXPtxDFtVzF+KxJKIE0QHQh+SZumr kR4O9eGuk4ajlmxJiqmGEvdP2CpKOhDxIxJGij1+PDZAAN/b4XCf69tZknD6L1JWXuqY G9FWTlWTH/3KSm2Euqf0RVeuVwNfZrAcCpcYZ+MKxsc1Hpx8jYz9iGveNr2ZQWQbm2ny ym6NL+n7q/2sWzfy+gLEe+VNQ69ybMypawjgk0BIYSvkl9Sab8DkR64gVljWiUbRbnTZ YFiTk1ruTF1YQU8vnBVkzsOZgh9L2So/GNY9S+IZ/vJYmaGmYhf6WK0pjNcNag/gjRcL 3XgA== X-Gm-Message-State: AOAM532JF03Afu9p9VsovHIcVmzo4p45xbazfmnn+CheIM7rGzInEFoz VvTc2V2NUo164C5SC1CSukU= X-Google-Smtp-Source: ABdhPJxJWoqoR8NlgYmU2t/2cOlsAQidHf3YhvcXCqd7PtfdVk6D/im+HxqGl/1xiHm9cUq+6VZvsg== X-Received: by 2002:adf:dd0b:: with SMTP id a11mr1477717wrm.41.1603882474739; Wed, 28 Oct 2020 03:54:34 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id s11sm6418129wrm.56.2020.10.28.03.54.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2020 03:54:34 -0700 (PDT) From: luca.boccassi@gmail.com To: Bruce Richardson Cc: Yingya Han , dpdk stable Date: Wed, 28 Oct 2020 10:45:19 +0000 Message-Id: <20201028104606.3504127-160-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201028104606.3504127-1-luca.boccassi@gmail.com> References: <20201028104606.3504127-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'eal/x86: fix memcpy AVX-512 enablement' has been queued to stable release 19.11.6 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: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.6 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/30/20. 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. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Luca Boccassi --- >From 73a7720e3abce74051e059370a1db04cfbd7b10a Mon Sep 17 00:00:00 2001 From: Bruce Richardson Date: Mon, 12 Oct 2020 15:51:48 +0100 Subject: [PATCH] eal/x86: fix memcpy AVX-512 enablement [ upstream commit e8a83681f458d95d197bd37208fed3c3900def03 ] When testing on some x86 platforms, code compiled with meson was observed running at a different power-license level to that compiled with make. This is due to the fact that meson auto-detects the instruction sets available on the system and enabled AVX512 rte_memcpy when AVX512 was available, while on make, a build time AVX-512 flag needed to be explicitly set to enable that AVX512 rte_memcpy code path. In the absence of runtime path selection for rte_memcpy - which is complicated by it being a static inline function in a header file - we can fix this behaviour regression by similarly having a build-time option which must be set to enable the AVX-512 memcpy path. Fixes: a25a650be5f0 ("build: add infrastructure for meson and ninja builds") Fixes: 3e1bb55fd6ef ("build/x86: add SSE flags") Signed-off-by: Bruce Richardson Tested-by: Yingya Han --- lib/librte_eal/common/include/arch/x86/rte_memcpy.h | 2 +- lib/librte_eal/common/include/generic/rte_memcpy.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/librte_eal/common/include/arch/x86/rte_memcpy.h b/lib/librte_eal/common/include/arch/x86/rte_memcpy.h index 9c67232df9..d01832fa15 100644 --- a/lib/librte_eal/common/include/arch/x86/rte_memcpy.h +++ b/lib/librte_eal/common/include/arch/x86/rte_memcpy.h @@ -45,7 +45,7 @@ extern "C" { static __rte_always_inline void * rte_memcpy(void *dst, const void *src, size_t n); -#ifdef RTE_MACHINE_CPUFLAG_AVX512F +#if defined RTE_MACHINE_CPUFLAG_AVX512F && defined RTE_MEMCPY_AVX512 #define ALIGNMENT_MASK 0x3F diff --git a/lib/librte_eal/common/include/generic/rte_memcpy.h b/lib/librte_eal/common/include/generic/rte_memcpy.h index 701e550c31..e7f0f8eaa9 100644 --- a/lib/librte_eal/common/include/generic/rte_memcpy.h +++ b/lib/librte_eal/common/include/generic/rte_memcpy.h @@ -95,6 +95,10 @@ rte_mov256(uint8_t *dst, const uint8_t *src); * @note This is implemented as a macro, so it's address should not be taken * and care is needed as parameter expressions may be evaluated multiple times. * + * @note For x86 platforms to enable the AVX-512 memcpy implementation, set + * -DRTE_MEMCPY_AVX512 macro in CFLAGS, or define the RTE_MEMCPY_AVX512 macro + * explicitly in the source file before including the rte_memcpy header file. + * * @param dst * Pointer to the destination of the data. * @param src -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-10-28 10:35:16.696918899 +0000 +++ 0160-eal-x86-fix-memcpy-AVX-512-enablement.patch 2020-10-28 10:35:11.756833733 +0000 @@ -1,8 +1,10 @@ -From e8a83681f458d95d197bd37208fed3c3900def03 Mon Sep 17 00:00:00 2001 +From 73a7720e3abce74051e059370a1db04cfbd7b10a Mon Sep 17 00:00:00 2001 From: Bruce Richardson Date: Mon, 12 Oct 2020 15:51:48 +0100 Subject: [PATCH] eal/x86: fix memcpy AVX-512 enablement +[ upstream commit e8a83681f458d95d197bd37208fed3c3900def03 ] + When testing on some x86 platforms, code compiled with meson was observed running at a different power-license level to that compiled with make. This is due to the fact that meson auto-detects the instruction sets available @@ -17,19 +19,31 @@ Fixes: a25a650be5f0 ("build: add infrastructure for meson and ninja builds") Fixes: 3e1bb55fd6ef ("build/x86: add SSE flags") -Cc: stable@dpdk.org Signed-off-by: Bruce Richardson Tested-by: Yingya Han --- - lib/librte_eal/include/generic/rte_memcpy.h | 4 ++++ - lib/librte_eal/x86/include/rte_memcpy.h | 2 +- + lib/librte_eal/common/include/arch/x86/rte_memcpy.h | 2 +- + lib/librte_eal/common/include/generic/rte_memcpy.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) -diff --git a/lib/librte_eal/include/generic/rte_memcpy.h b/lib/librte_eal/include/generic/rte_memcpy.h +diff --git a/lib/librte_eal/common/include/arch/x86/rte_memcpy.h b/lib/librte_eal/common/include/arch/x86/rte_memcpy.h +index 9c67232df9..d01832fa15 100644 +--- a/lib/librte_eal/common/include/arch/x86/rte_memcpy.h ++++ b/lib/librte_eal/common/include/arch/x86/rte_memcpy.h +@@ -45,7 +45,7 @@ extern "C" { + static __rte_always_inline void * + rte_memcpy(void *dst, const void *src, size_t n); + +-#ifdef RTE_MACHINE_CPUFLAG_AVX512F ++#if defined RTE_MACHINE_CPUFLAG_AVX512F && defined RTE_MEMCPY_AVX512 + + #define ALIGNMENT_MASK 0x3F + +diff --git a/lib/librte_eal/common/include/generic/rte_memcpy.h b/lib/librte_eal/common/include/generic/rte_memcpy.h index 701e550c31..e7f0f8eaa9 100644 ---- a/lib/librte_eal/include/generic/rte_memcpy.h -+++ b/lib/librte_eal/include/generic/rte_memcpy.h +--- a/lib/librte_eal/common/include/generic/rte_memcpy.h ++++ b/lib/librte_eal/common/include/generic/rte_memcpy.h @@ -95,6 +95,10 @@ rte_mov256(uint8_t *dst, const uint8_t *src); * @note This is implemented as a macro, so it's address should not be taken * and care is needed as parameter expressions may be evaluated multiple times. @@ -41,19 +55,6 @@ * @param dst * Pointer to the destination of the data. * @param src -diff --git a/lib/librte_eal/x86/include/rte_memcpy.h b/lib/librte_eal/x86/include/rte_memcpy.h -index 008a3de67f..79f381dd9b 100644 ---- a/lib/librte_eal/x86/include/rte_memcpy.h -+++ b/lib/librte_eal/x86/include/rte_memcpy.h -@@ -45,7 +45,7 @@ extern "C" { - static __rte_always_inline void * - rte_memcpy(void *dst, const void *src, size_t n); - --#ifdef __AVX512F__ -+#if defined __AVX512F__ && defined RTE_MEMCPY_AVX512 - - #define ALIGNMENT_MASK 0x3F - -- 2.20.1