From patchwork Mon Jan 9 10:03:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 121731 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B6AB8418FE; Mon, 9 Jan 2023 11:04:24 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AAAE740687; Mon, 9 Jan 2023 11:04:24 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id C6C3F4067C for ; Mon, 9 Jan 2023 11:04:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673258662; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MroNFQ0r7xe86j5iP3MdWMKcwLommbcHNVuBcu4YshE=; b=hDsC55pdwIXsSH+DbvgoO9KS2z6UmWYMExDRjkzek4J821V1esPiaZ52UScK33VRgR85wK 9zK2LQNKocB68dTqD/RYnS/laJneTzPANtQ45KSWNKnX2dHEw0kp2A3MfhJA84JlvY3WGf wmFxj3ARn3dHTdfEJF/M7zIk59ceMe4= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-179--sHKocG8O3mMPqdPsIAQHA-1; Mon, 09 Jan 2023 05:04:05 -0500 X-MC-Unique: -sHKocG8O3mMPqdPsIAQHA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 09FC9100F91F; Mon, 9 Jan 2023 10:04:05 +0000 (UTC) Received: from dmarchan.redhat.com (ovpn-193-12.brq.redhat.com [10.40.193.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id C733E1121319; Mon, 9 Jan 2023 10:04:03 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Yipeng Wang , Sameh Gobriel , Bruce Richardson , Vladimir Medvedkin , stable@dpdk.org Subject: [PATCH] hash: fix GFNI implementation build with GCC 12 Date: Mon, 9 Jan 2023 11:03:37 +0100 Message-Id: <20230109100337.714937-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 Acked-by: Bruce Richardson --- 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;