[dpdk-stable] patch 'acl: fix build with GCC 11' has been queued to stable release 20.11.2

Xueming Li xuemingl at nvidia.com
Sat Jun 12 01:01:44 CEST 2021


Hi,

FYI, your patch has been queued to stable release 20.11.2

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

Queued patches are on a temporary branch at:
https://github.com/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/a5fd2098d6e839c2266f3f80279e1e6f3164a6a1

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From a5fd2098d6e839c2266f3f80279e1e6f3164a6a1 Mon Sep 17 00:00:00 2001
From: Konstantin Ananyev <konstantin.ananyev at intel.com>
Date: Mon, 26 Apr 2021 14:35:19 +0100
Subject: [PATCH] acl: fix build with GCC 11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Luca Boccassi <bluca at debian.org>

[ upstream commit 8e2dd74f0afd3ef3358f1cca05afb20bda670207 ]

gcc 11 with '-O2' complains about some variables being used without
being initialized:

In function ‘start_flow_avx512x8’,
    inlined from ‘search_trie_avx512x8.constprop’ at acl_run_avx512_common.h:317:
lib/librte_acl/acl_run_avx512_common.h:210:13: warning:
    ‘pdata’ is used uninitialized [-Wuninitialized]
In function ‘search_trie_avx512x8.constprop’:
lib/librte_acl/acl_run_avx512_common.h:314:32: note: ‘pdata’ declared here
...

Indeed, these variables are not explicitly initialized,
but this is done intentionally.
We rely on constant mask value that we pass to start_flow*() functions
as a parameter to mask out uninitialized values.
Note that '-O3' doesn't produce this warning.
Anyway, to support clean build with gcc-11 this patch adds
explicit initialization for these variables.
I checked the output binary: with '-O3' both clang and gcc 10/11
generate no extra code for it.
Also performance test didn't reveal any regressions.

Bugzilla ID: 673
Fixes: b64c2295f7fc ("acl: add 256-bit AVX512 classify method")
Fixes: 45da22e42ec3 ("acl: add 512-bit AVX512 classify method")

Reported-by: Ali Alnubani <alialnu at nvidia.com>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev at intel.com>
---
 lib/librte_acl/acl_run_avx512_common.h | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/lib/librte_acl/acl_run_avx512_common.h b/lib/librte_acl/acl_run_avx512_common.h
index fafaf591e8..fbad74d459 100644
--- a/lib/librte_acl/acl_run_avx512_common.h
+++ b/lib/librte_acl/acl_run_avx512_common.h
@@ -303,6 +303,28 @@ _F_(match_check_process)(struct acl_flow_avx512 *flow, uint32_t fm[2],
 	}
 }
 
+static inline void
+_F_(reset_flow_vars)(_T_simd di[2], _T_simd idx[2], _T_simd pdata[4],
+	_T_simd tr_lo[2], _T_simd tr_hi[2])
+{
+	di[0] = _M_SI_(setzero)();
+	di[1] = _M_SI_(setzero)();
+
+	idx[0] = _M_SI_(setzero)();
+	idx[1] = _M_SI_(setzero)();
+
+	pdata[0] = _M_SI_(setzero)();
+	pdata[1] = _M_SI_(setzero)();
+	pdata[2] = _M_SI_(setzero)();
+	pdata[3] = _M_SI_(setzero)();
+
+	tr_lo[0] = _M_SI_(setzero)();
+	tr_lo[1] = _M_SI_(setzero)();
+
+	tr_hi[0] = _M_SI_(setzero)();
+	tr_hi[1] = _M_SI_(setzero)();
+}
+
 /*
  * Perform search for up to (2 * _N_) flows in parallel.
  * Use two sets of metadata, each serves _N_ flows max.
@@ -313,6 +335,8 @@ _F_(search_trie)(struct acl_flow_avx512 *flow)
 	uint32_t fm[2];
 	_T_simd di[2], idx[2], in[2], pdata[4], tr_lo[2], tr_hi[2];
 
+	_F_(reset_flow_vars)(di, idx, pdata, tr_lo, tr_hi);
+
 	/* first 1B load */
 	_F_(start_flow)(flow, _SIMD_MASK_BIT_, _SIMD_MASK_MAX_,
 			&pdata[0], &idx[0], &di[0]);
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-06-12 06:53:56.955338300 +0800
+++ 0010-acl-fix-build-with-GCC-11.patch	2021-06-12 06:53:56.010000000 +0800
@@ -1 +1 @@
-From 8e2dd74f0afd3ef3358f1cca05afb20bda670207 Mon Sep 17 00:00:00 2001
+From a5fd2098d6e839c2266f3f80279e1e6f3164a6a1 Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Luca Boccassi <bluca at debian.org>
+
+[ upstream commit 8e2dd74f0afd3ef3358f1cca05afb20bda670207 ]
@@ -34 +36,0 @@
-Cc: stable at dpdk.org
@@ -39 +41 @@
- lib/acl/acl_run_avx512_common.h | 24 ++++++++++++++++++++++++
+ lib/librte_acl/acl_run_avx512_common.h | 24 ++++++++++++++++++++++++
@@ -42 +44 @@
-diff --git a/lib/acl/acl_run_avx512_common.h b/lib/acl/acl_run_avx512_common.h
+diff --git a/lib/librte_acl/acl_run_avx512_common.h b/lib/librte_acl/acl_run_avx512_common.h
@@ -44,2 +46,2 @@
---- a/lib/acl/acl_run_avx512_common.h
-+++ b/lib/acl/acl_run_avx512_common.h
+--- a/lib/librte_acl/acl_run_avx512_common.h
++++ b/lib/librte_acl/acl_run_avx512_common.h


More information about the stable mailing list