patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH] hash: fix GFNI implementation build with GCC 12
@ 2023-01-09 10:03 David Marchand
  2023-01-09 10:24 ` Bruce Richardson
  0 siblings, 1 reply; 3+ messages in thread
From: David Marchand @ 2023-01-09 10:03 UTC (permalink / raw)
  To: dev
  Cc: Yipeng Wang, Sameh Gobriel, Bruce Richardson, Vladimir Medvedkin, stable

On a system that has AVX512F and GFNI, compiling fails with:

In file included from /usr/lib/gcc/x86_64-redhat-linux/12/include/immintrin.h:71,
                 from /usr/lib/gcc/x86_64-redhat-linux/12/include/x86intrin.h:32,
                 from ../../../git/pub/dpdk.org/main/lib/eal/x86/include/rte_vect.h:31,
                 from ../../../git/pub/dpdk.org/main/lib/eal/x86/include/rte_memcpy.h:17,
                 from ../../../git/pub/dpdk.org/main/lib/mempool/rte_mempool.h:48,
                 from ../../../git/pub/dpdk.org/main/lib/mbuf/rte_mbuf.h:38,
                 from ../../../git/pub/dpdk.org/main/lib/net/rte_ip.h:33,
                 from ../../../git/pub/dpdk.org/main/lib/hash/rte_thash.h:25,
                 from ../../../git/pub/dpdk.org/main/lib/hash/rte_thash.c:7:
In function ‘_mm512_mask_permutexvar_epi8’,
    inlined from ‘__rte_thash_gfni’ at
	../../../git/pub/dpdk.org/main/lib/hash/rte_thash_x86_gfni.h:142:17,
    inlined from ‘rte_thash_gfni’ at
	../../../git/pub/dpdk.org/main/lib/hash/rte_thash_x86_gfni.h:182:20,
    inlined from ‘rte_thash_adjust_tuple’ at
	../../../git/pub/dpdk.org/main/lib/hash/rte_thash.c:784:11:
/usr/lib/gcc/x86_64-redhat-linux/12/include/avx512vbmiintrin.h:97:20:
	error: ‘tuple_bytes’ may be used uninitialized [-Werror=maybe-uninitialized]
   97 |   return (__m512i) __builtin_ia32_permvarqi512_mask ((__v64qi) __B,
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   98 |                                                      (__v64qi) __A,
      |                                                      ~~~~~~~~~~~~~~
   99 |                                                      (__v64qi) __W,
      |                                                      ~~~~~~~~~~~~~~
  100 |                                                      (__mmask64) __M);
      |                                                      ~~~~~~~~~~~~~~~~

And:

In file included from ../../../git/pub/dpdk.org/main/lib/hash/rte_thash_gfni.h:17,
                 from ../../../git/pub/dpdk.org/main/lib/hash/rte_thash.h:27:
../../../git/pub/dpdk.org/main/lib/hash/rte_thash_x86_gfni.h:
	In function ‘rte_thash_adjust_tuple’:
../../../git/pub/dpdk.org/main/lib/hash/rte_thash_x86_gfni.h:91:33:
	note: ‘tuple_bytes’ was declared here
   91 |         __m512i vals, matrixes, tuple_bytes, tuple_bytes_2;
      |                                 ^~~~~~~~~~~
In function ‘_mm512_mask_permutexvar_epi8’,
    inlined from ‘__rte_thash_gfni’ at
	../../../git/pub/dpdk.org/main/lib/hash/rte_thash_x86_gfni.h:142:17,
    inlined from ‘rte_thash_gfni’ at
	../../../git/pub/dpdk.org/main/lib/hash/rte_thash_x86_gfni.h:182:20,
    inlined from ‘rte_thash_adjust_tuple’ at
	../../../git/pub/dpdk.org/main/lib/hash/rte_thash.c:784:11:
/usr/lib/gcc/x86_64-redhat-linux/12/include/avx512vbmiintrin.h:97:20:
	error: ‘permute_mask’ may be used uninitialized [-Werror=maybe-uninitialized]
   97 |   return (__m512i) __builtin_ia32_permvarqi512_mask ((__v64qi) __B,
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   98 |                                                      (__v64qi) __A,
      |                                                      ~~~~~~~~~~~~~~
   99 |                                                      (__v64qi) __W,
      |                                                      ~~~~~~~~~~~~~~
  100 |                                                      (__mmask64) __M);
      |                                                      ~~~~~~~~~~~~~~~~
../../../git/pub/dpdk.org/main/lib/hash/rte_thash_x86_gfni.h:
	In function ‘rte_thash_adjust_tuple’:
../../../git/pub/dpdk.org/main/lib/hash/rte_thash_x86_gfni.h:92:30:
	note: ‘permute_mask’ was declared here
   92 |         __mmask64 load_mask, permute_mask, permute_mask_2;
      |                              ^~~~~~~~~~~~
cc1: all warnings being treated as errors

Set those variables to 0.

Fixes: 4fd8c4cb0de1 ("hash: add new Toeplitz hash implementation")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 lib/hash/rte_thash_x86_gfni.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/hash/rte_thash_x86_gfni.h b/lib/hash/rte_thash_x86_gfni.h
index 880739b710..7bb76ac1bb 100644
--- a/lib/hash/rte_thash_x86_gfni.h
+++ b/lib/hash/rte_thash_x86_gfni.h
@@ -88,8 +88,10 @@ __rte_thash_gfni(const uint64_t *mtrx, const uint8_t *tuple,
 	const __m512i shift_8 = _mm512_set1_epi8(8);
 	__m512i xor_acc = _mm512_setzero_si512();
 	__m512i perm_bytes = _mm512_setzero_si512();
-	__m512i vals, matrixes, tuple_bytes, tuple_bytes_2;
-	__mmask64 load_mask, permute_mask, permute_mask_2;
+	__m512i vals, matrixes, tuple_bytes_2;
+	__m512i tuple_bytes = _mm512_setzero_si512();
+	__mmask64 load_mask, permute_mask_2;
+	__mmask64 permute_mask = 0;
 	int chunk_len = 0, i = 0;
 	uint8_t mtrx_msk;
 	const int prepend = 3;
-- 
2.39.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] hash: fix GFNI implementation build with GCC 12
  2023-01-09 10:03 [PATCH] hash: fix GFNI implementation build with GCC 12 David Marchand
@ 2023-01-09 10:24 ` Bruce Richardson
  2023-01-09 17:47   ` David Marchand
  0 siblings, 1 reply; 3+ messages in thread
From: Bruce Richardson @ 2023-01-09 10:24 UTC (permalink / raw)
  To: David Marchand
  Cc: dev, Yipeng Wang, Sameh Gobriel, Vladimir Medvedkin, stable

On Mon, Jan 09, 2023 at 11:03:37AM +0100, David Marchand wrote:
> On a system that has AVX512F and GFNI, compiling fails with:
> 
> In file included from /usr/lib/gcc/x86_64-redhat-linux/12/include/immintrin.h:71,
>                  from /usr/lib/gcc/x86_64-redhat-linux/12/include/x86intrin.h:32,
>                  from ../../../git/pub/dpdk.org/main/lib/eal/x86/include/rte_vect.h:31,
>                  from ../../../git/pub/dpdk.org/main/lib/eal/x86/include/rte_memcpy.h:17,
>                  from ../../../git/pub/dpdk.org/main/lib/mempool/rte_mempool.h:48,
>                  from ../../../git/pub/dpdk.org/main/lib/mbuf/rte_mbuf.h:38,
>                  from ../../../git/pub/dpdk.org/main/lib/net/rte_ip.h:33,
>                  from ../../../git/pub/dpdk.org/main/lib/hash/rte_thash.h:25,
>                  from ../../../git/pub/dpdk.org/main/lib/hash/rte_thash.c:7:
> In function ‘_mm512_mask_permutexvar_epi8’,
>     inlined from ‘__rte_thash_gfni’ at
> 	../../../git/pub/dpdk.org/main/lib/hash/rte_thash_x86_gfni.h:142:17,
>     inlined from ‘rte_thash_gfni’ at
> 	../../../git/pub/dpdk.org/main/lib/hash/rte_thash_x86_gfni.h:182:20,
>     inlined from ‘rte_thash_adjust_tuple’ at
> 	../../../git/pub/dpdk.org/main/lib/hash/rte_thash.c:784:11:
> /usr/lib/gcc/x86_64-redhat-linux/12/include/avx512vbmiintrin.h:97:20:
> 	error: ‘tuple_bytes’ may be used uninitialized [-Werror=maybe-uninitialized]
>    97 |   return (__m512i) __builtin_ia32_permvarqi512_mask ((__v64qi) __B,
>       |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    98 |                                                      (__v64qi) __A,
>       |                                                      ~~~~~~~~~~~~~~
>    99 |                                                      (__v64qi) __W,
>       |                                                      ~~~~~~~~~~~~~~
>   100 |                                                      (__mmask64) __M);
>       |                                                      ~~~~~~~~~~~~~~~~
> 
> And:
> 
> In file included from ../../../git/pub/dpdk.org/main/lib/hash/rte_thash_gfni.h:17,
>                  from ../../../git/pub/dpdk.org/main/lib/hash/rte_thash.h:27:
> ../../../git/pub/dpdk.org/main/lib/hash/rte_thash_x86_gfni.h:
> 	In function ‘rte_thash_adjust_tuple’:
> ../../../git/pub/dpdk.org/main/lib/hash/rte_thash_x86_gfni.h:91:33:
> 	note: ‘tuple_bytes’ was declared here
>    91 |         __m512i vals, matrixes, tuple_bytes, tuple_bytes_2;
>       |                                 ^~~~~~~~~~~
> In function ‘_mm512_mask_permutexvar_epi8’,
>     inlined from ‘__rte_thash_gfni’ at
> 	../../../git/pub/dpdk.org/main/lib/hash/rte_thash_x86_gfni.h:142:17,
>     inlined from ‘rte_thash_gfni’ at
> 	../../../git/pub/dpdk.org/main/lib/hash/rte_thash_x86_gfni.h:182:20,
>     inlined from ‘rte_thash_adjust_tuple’ at
> 	../../../git/pub/dpdk.org/main/lib/hash/rte_thash.c:784:11:
> /usr/lib/gcc/x86_64-redhat-linux/12/include/avx512vbmiintrin.h:97:20:
> 	error: ‘permute_mask’ may be used uninitialized [-Werror=maybe-uninitialized]
>    97 |   return (__m512i) __builtin_ia32_permvarqi512_mask ((__v64qi) __B,
>       |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    98 |                                                      (__v64qi) __A,
>       |                                                      ~~~~~~~~~~~~~~
>    99 |                                                      (__v64qi) __W,
>       |                                                      ~~~~~~~~~~~~~~
>   100 |                                                      (__mmask64) __M);
>       |                                                      ~~~~~~~~~~~~~~~~
> ../../../git/pub/dpdk.org/main/lib/hash/rte_thash_x86_gfni.h:
> 	In function ‘rte_thash_adjust_tuple’:
> ../../../git/pub/dpdk.org/main/lib/hash/rte_thash_x86_gfni.h:92:30:
> 	note: ‘permute_mask’ was declared here
>    92 |         __mmask64 load_mask, permute_mask, permute_mask_2;
>       |                              ^~~~~~~~~~~~
> cc1: all warnings being treated as errors
> 
> Set those variables to 0.
> 
> Fixes: 4fd8c4cb0de1 ("hash: add new Toeplitz hash implementation")
> Cc: stable@dpdk.org
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
>  lib/hash/rte_thash_x86_gfni.h | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 

Hit this issue myself before, but somehow never got to pushing out a patch
for it. Thanks for doing so.

Acked-by: Bruce Richardson <bruce.richardson@intel.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] hash: fix GFNI implementation build with GCC 12
  2023-01-09 10:24 ` Bruce Richardson
@ 2023-01-09 17:47   ` David Marchand
  0 siblings, 0 replies; 3+ messages in thread
From: David Marchand @ 2023-01-09 17:47 UTC (permalink / raw)
  To: David Marchand
  Cc: Bruce Richardson, dev, Yipeng Wang, Sameh Gobriel,
	Vladimir Medvedkin, stable

On Mon, Jan 9, 2023 at 11:24 AM Bruce Richardson
<bruce.richardson@intel.com> wrote:
> On Mon, Jan 09, 2023 at 11:03:37AM +0100, David Marchand wrote:
> > On a system that has AVX512F and GFNI, compiling fails with:
> >
> > In file included from /usr/lib/gcc/x86_64-redhat-linux/12/include/immintrin.h:71,
> >                  from /usr/lib/gcc/x86_64-redhat-linux/12/include/x86intrin.h:32,
> >                  from ../../../git/pub/dpdk.org/main/lib/eal/x86/include/rte_vect.h:31,
> >                  from ../../../git/pub/dpdk.org/main/lib/eal/x86/include/rte_memcpy.h:17,
> >                  from ../../../git/pub/dpdk.org/main/lib/mempool/rte_mempool.h:48,
> >                  from ../../../git/pub/dpdk.org/main/lib/mbuf/rte_mbuf.h:38,
> >                  from ../../../git/pub/dpdk.org/main/lib/net/rte_ip.h:33,
> >                  from ../../../git/pub/dpdk.org/main/lib/hash/rte_thash.h:25,
> >                  from ../../../git/pub/dpdk.org/main/lib/hash/rte_thash.c:7:
> > In function ‘_mm512_mask_permutexvar_epi8’,
> >     inlined from ‘__rte_thash_gfni’ at
> >       ../../../git/pub/dpdk.org/main/lib/hash/rte_thash_x86_gfni.h:142:17,
> >     inlined from ‘rte_thash_gfni’ at
> >       ../../../git/pub/dpdk.org/main/lib/hash/rte_thash_x86_gfni.h:182:20,
> >     inlined from ‘rte_thash_adjust_tuple’ at
> >       ../../../git/pub/dpdk.org/main/lib/hash/rte_thash.c:784:11:
> > /usr/lib/gcc/x86_64-redhat-linux/12/include/avx512vbmiintrin.h:97:20:
> >       error: ‘tuple_bytes’ may be used uninitialized [-Werror=maybe-uninitialized]
> >    97 |   return (__m512i) __builtin_ia32_permvarqi512_mask ((__v64qi) __B,
> >       |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >    98 |                                                      (__v64qi) __A,
> >       |                                                      ~~~~~~~~~~~~~~
> >    99 |                                                      (__v64qi) __W,
> >       |                                                      ~~~~~~~~~~~~~~
> >   100 |                                                      (__mmask64) __M);
> >       |                                                      ~~~~~~~~~~~~~~~~
> >
> > And:
> >
> > In file included from ../../../git/pub/dpdk.org/main/lib/hash/rte_thash_gfni.h:17,
> >                  from ../../../git/pub/dpdk.org/main/lib/hash/rte_thash.h:27:
> > ../../../git/pub/dpdk.org/main/lib/hash/rte_thash_x86_gfni.h:
> >       In function ‘rte_thash_adjust_tuple’:
> > ../../../git/pub/dpdk.org/main/lib/hash/rte_thash_x86_gfni.h:91:33:
> >       note: ‘tuple_bytes’ was declared here
> >    91 |         __m512i vals, matrixes, tuple_bytes, tuple_bytes_2;
> >       |                                 ^~~~~~~~~~~
> > In function ‘_mm512_mask_permutexvar_epi8’,
> >     inlined from ‘__rte_thash_gfni’ at
> >       ../../../git/pub/dpdk.org/main/lib/hash/rte_thash_x86_gfni.h:142:17,
> >     inlined from ‘rte_thash_gfni’ at
> >       ../../../git/pub/dpdk.org/main/lib/hash/rte_thash_x86_gfni.h:182:20,
> >     inlined from ‘rte_thash_adjust_tuple’ at
> >       ../../../git/pub/dpdk.org/main/lib/hash/rte_thash.c:784:11:
> > /usr/lib/gcc/x86_64-redhat-linux/12/include/avx512vbmiintrin.h:97:20:
> >       error: ‘permute_mask’ may be used uninitialized [-Werror=maybe-uninitialized]
> >    97 |   return (__m512i) __builtin_ia32_permvarqi512_mask ((__v64qi) __B,
> >       |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >    98 |                                                      (__v64qi) __A,
> >       |                                                      ~~~~~~~~~~~~~~
> >    99 |                                                      (__v64qi) __W,
> >       |                                                      ~~~~~~~~~~~~~~
> >   100 |                                                      (__mmask64) __M);
> >       |                                                      ~~~~~~~~~~~~~~~~
> > ../../../git/pub/dpdk.org/main/lib/hash/rte_thash_x86_gfni.h:
> >       In function ‘rte_thash_adjust_tuple’:
> > ../../../git/pub/dpdk.org/main/lib/hash/rte_thash_x86_gfni.h:92:30:
> >       note: ‘permute_mask’ was declared here
> >    92 |         __mmask64 load_mask, permute_mask, permute_mask_2;
> >       |                              ^~~~~~~~~~~~
> > cc1: all warnings being treated as errors
> >
> > Set those variables to 0.
> >
> > Fixes: 4fd8c4cb0de1 ("hash: add new Toeplitz hash implementation")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: David Marchand <david.marchand@redhat.com>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>

Applied, thanks.


-- 
David Marchand


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-01-09 17:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-09 10:03 [PATCH] hash: fix GFNI implementation build with GCC 12 David Marchand
2023-01-09 10:24 ` Bruce Richardson
2023-01-09 17:47   ` David Marchand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).