From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AAB5F41D30; Tue, 21 Feb 2023 16:10:49 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8F49B431E8; Tue, 21 Feb 2023 16:10:49 +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 6A0A840E0F for ; Tue, 21 Feb 2023 16:10:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676992247; 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: in-reply-to:in-reply-to:references:references; bh=nAC1VIC+VeX2YcjJA4TmGx9APPYmqjhI69pC1BiLw7o=; b=imrnhHwUUQ05j13AwMSSv65nXcC19lw4/BFWkfVp7Of5khD9Do0C+FqGxY9nawz1xHTH/C FjdjAY9TTOS0sJjxOeldPq36bcIfurys7CVTWqKVfOsavTSTmIc7fCnB6HnSWOglrcdea7 JncFfS5CyUlz3wWw5OiqEZxixQjCmbU= Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-153-WddtqzqkPDG0eTzkrBIWfQ-1; Tue, 21 Feb 2023 10:10:44 -0500 X-MC-Unique: WddtqzqkPDG0eTzkrBIWfQ-1 Received: by mail-pg1-f200.google.com with SMTP id n11-20020a63e04b000000b004fac0fa0f9eso1681910pgj.19 for ; Tue, 21 Feb 2023 07:10:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nAC1VIC+VeX2YcjJA4TmGx9APPYmqjhI69pC1BiLw7o=; b=cgIfp4pbKFA8VutoT4/asa7O6VjdbP7QNnqUdHuY0mvLxQa2iq3mnJ2nAn+hWFTZPu 6Yo6qrpQpDV2uwsd5r4783pnGwN4drZumrrBfDowpypMTn3r97VcUjGqWCaNiTM8236E rBcreZXaIFf8we+dygAoNaIJOcqd8qn6ScMIQdhvIyNMRfNDouJu1g+Q3J4J2wjLi2hF NyPmb+dUcb2J/H4w4zKRVrmrU2fT+/3B6Xfeh715fD8aWNGZj3sw1X7+Ch64J4pucsoz Q/7d8l3Ir2KO+OJ5IOz8k0s7kDyPNLlcJkkcndoQOfIDG6VBVpf0VrcBegm5NtKMpWLo eRnA== X-Gm-Message-State: AO0yUKVi7kLgKPuLJalprKoBKYdk1EY5SfVc6llwaXfcyH6Ioe+bwWtZ AmZprCYOHuVNvVbzJT9QljkJUJiV1GqA2rE6TIQdbrKd/Hvb6AieUAssxfAe3Yb0W9mTDnw9/wc gWK/n1A00lKZwT+15LBc= X-Received: by 2002:a17:903:25c2:b0:19c:9999:e893 with SMTP id jc2-20020a17090325c200b0019c9999e893mr237729plb.22.1676992243059; Tue, 21 Feb 2023 07:10:43 -0800 (PST) X-Google-Smtp-Source: AK7set/q6lWGs6Ffr6H6qvZ9/rXCpXCa4tefygd+InO26nGUt8QgqAJuO5DSvGzPZ7s7trCU5jix+TO3QBWKcg/5Pbw= X-Received: by 2002:a17:903:25c2:b0:19c:9999:e893 with SMTP id jc2-20020a17090325c200b0019c9999e893mr237722plb.22.1676992242629; Tue, 21 Feb 2023 07:10:42 -0800 (PST) MIME-Version: 1.0 References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230220233556.168553-1-stephen@networkplumber.org> <20230220233556.168553-22-stephen@networkplumber.org> In-Reply-To: <20230220233556.168553-22-stephen@networkplumber.org> From: David Marchand Date: Tue, 21 Feb 2023 16:10:31 +0100 Message-ID: Subject: Re: [PATCH v8 21/22] hash: move rte_hash_set_alg out header To: Stephen Hemminger Cc: dev@dpdk.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Tue, Feb 21, 2023 at 12:38 AM Stephen Hemminger wrote: > diff --git a/lib/hash/rte_hash_crc.c b/lib/hash/rte_hash_crc.c > new file mode 100644 > index 000000000000..c59eebccb1eb > --- /dev/null > +++ b/lib/hash/rte_hash_crc.c > @@ -0,0 +1,63 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(c) 2010-2014 Intel Corporation > + */ > + > +#include > +#include > + > +#include "rte_hash_crc.h" > + > +/** > + * Allow or disallow use of SSE4.2/ARMv8 intrinsics for CRC32 hash > + * calculation. > + * > + * @param alg > + * An OR of following flags: > + * - (CRC32_SW) Don't use SSE4.2/ARMv8 intrinsics (default non-[x86/AR= Mv8]) > + * - (CRC32_SSE42) Use SSE4.2 intrinsics if available > + * - (CRC32_SSE42_x64) Use 64-bit SSE4.2 intrinsic if available (defau= lt x86) > + * - (CRC32_ARM64) Use ARMv8 CRC intrinsic if available (default ARMv8= ) > + * > + */ > +void > +rte_hash_crc_set_alg(uint8_t alg) > +{ > + crc32_alg =3D CRC32_SW; > + > + if (alg =3D=3D CRC32_SW) > + return; > + > +#if defined RTE_ARCH_X86 > + if (!(alg & CRC32_SSE42_x64)) > + RTE_LOG(WARNING, HASH, > + "Unsupported CRC32 algorithm requested using CRC3= 2_x64/CRC32_SSE42\n"); > + if (!rte_cpu_get_flag_enabled(RTE_CPUFLAG_EM64T) || alg =3D=3D CR= C32_SSE42) > + crc32_alg =3D CRC32_SSE42; > + else > + crc32_alg =3D CRC32_SSE42_x64; > +#endif > + > +#if defined RTE_ARCH_ARM64 > + if (!(alg & CRC32_ARM64)) > + RTE_LOG(WARNING, HASH, > + "Unsupported CRC32 algorithm requested using CRC3= 2_ARM64\n"); > + if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_CRC32)) > + crc32_alg =3D CRC32_ARM64; > +#endif > + > + if (crc32_alg =3D=3D CRC32_SW) > + RTE_LOG(WARNING, HASH, > + "Unsupported CRC32 algorithm requested using CRC3= 2_SW\n"); > +} > + > +/* Setting the best available algorithm */ > +RTE_INIT(rte_hash_crc_init_alg) > +{ > +#if defined(RTE_ARCH_X86) > + rte_hash_crc_set_alg(CRC32_SSE42_x64); > +#elif defined(RTE_ARCH_ARM64) && defined(__ARM_FEATURE_CRC32) > + rte_hash_crc_set_alg(CRC32_ARM64); > +#else > + rte_hash_crc_set_alg(CRC32_SW); > +#endif > +} > diff --git a/lib/hash/rte_hash_crc.h b/lib/hash/rte_hash_crc.h > index 0249ad16c5b6..e4acd99a0c81 100644 > --- a/lib/hash/rte_hash_crc.h > +++ b/lib/hash/rte_hash_crc.h > @@ -20,8 +20,6 @@ extern "C" { > #include > #include > #include > -#include > -#include > > #include "rte_crc_sw.h" > > @@ -53,48 +51,8 @@ static uint8_t crc32_alg =3D CRC32_SW; > * - (CRC32_ARM64) Use ARMv8 CRC intrinsic if available (default ARMv8= ) > * > */ > -static inline void > -rte_hash_crc_set_alg(uint8_t alg) > -{ > - crc32_alg =3D CRC32_SW; > - > - if (alg =3D=3D CRC32_SW) > - return; > - > -#if defined RTE_ARCH_X86 > - if (!(alg & CRC32_SSE42_x64)) > - RTE_LOG(WARNING, HASH, > - "Unsupported CRC32 algorithm requested using CRC3= 2_x64/CRC32_SSE42\n"); > - if (!rte_cpu_get_flag_enabled(RTE_CPUFLAG_EM64T) || alg =3D=3D CR= C32_SSE42) > - crc32_alg =3D CRC32_SSE42; > - else > - crc32_alg =3D CRC32_SSE42_x64; > -#endif > - > -#if defined RTE_ARCH_ARM64 > - if (!(alg & CRC32_ARM64)) > - RTE_LOG(WARNING, HASH, > - "Unsupported CRC32 algorithm requested using CRC3= 2_ARM64\n"); > - if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_CRC32)) > - crc32_alg =3D CRC32_ARM64; > -#endif > - > - if (crc32_alg =3D=3D CRC32_SW) > - RTE_LOG(WARNING, HASH, > - "Unsupported CRC32 algorithm requested using CRC3= 2_SW\n"); > -} > - > -/* Setting the best available algorithm */ > -RTE_INIT(rte_hash_crc_init_alg) > -{ > -#if defined(RTE_ARCH_X86) > - rte_hash_crc_set_alg(CRC32_SSE42_x64); > -#elif defined(RTE_ARCH_ARM64) && defined(__ARM_FEATURE_CRC32) > - rte_hash_crc_set_alg(CRC32_ARM64); > -#else > - rte_hash_crc_set_alg(CRC32_SW); > -#endif > -} > +void > +rte_hash_crc_set_alg(uint8_t alg); There is likely something unfinished with this code move. See test report from GHA. http://mails.dpdk.org/archives/test-report/2023-February/356932.html [174/3761] Compiling C object 'lib/76b5a35@@rte_hash at sta/hash_rte_fbk_hash.c.o'. FAILED: lib/76b5a35@@rte_hash at sta/hash_rte_fbk_hash.c.o ccache powerpc64le-linux-gnu-gcc -Ilib/76b5a35@@rte_hash at sta -Ilib -I../lib -Ilib/hash -I../lib/hash -I. -I../ -Iconfig -I../config -Ilib/eal/include -I../lib/eal/include -Ilib/eal/linux/include -I../lib/eal/linux/include -Ilib/eal/ppc/include -I../lib/eal/ppc/include -Ilib/eal/common -I../lib/eal/common -Ilib/eal -I../lib/eal -Ilib/kvargs -I../lib/kvargs -Ilib/telemetry/../metrics -I../lib/telemetry/../metrics -Ilib/telemetry -I../lib/telemetry -Ilib/net -I../lib/net -Ilib/mbuf -I../lib/mbuf -Ilib/mempool -I../lib/mempool -Ilib/ring -I../lib/ring -Ilib/rcu -I../lib/rcu -fdiagnostics-color=3Dalways -pipe -D_FILE_OFFSET_BITS=3D64 -Wall -Winvalid-pch -Wextra -Werror -O2 -g -include rte_config.h -Wcast-qual -Wdeprecated -Wformat -Wformat-nonliteral -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wsign-compare -Wstrict-prototypes -Wundef -Wwrite-strings -Wno-address-of-packed-member -Wno-packed-not-aligned -Wno-missing-field-initializers -D_GNU_SOURCE -fPIC -mcpu=3Dpower8 -mtune=3Dpower8 -DALLOW_EXPERIMENTAL_API -DALLOW_INTERNAL_API -Wno-format-truncation -DRTE_LOG_DEFAULT_LOGTYPE=3Dlib.hash -MD -MQ 'lib/76b5a35@@rte_hash at sta/hash_rte_fbk_hash.c.o' -MF 'lib/76b5a35@@rte_hash at sta/hash_rte_fbk_hash.c.o.d' -o 'lib/76b5a35@@rte_hash at sta/hash_rte_fbk_hash.c.o' -c ../lib/hash/rte_fbk_hash.c In file included from ../lib/hash/rte_fbk_hash.h:27, from ../lib/hash/rte_fbk_hash.c:21: ../lib/hash/rte_hash_crc.h:32:16: error: =E2=80=98crc32_alg=E2=80=99 define= d but not used [-Werror=3Dunused-variable] 32 | static uint8_t crc32_alg =3D CRC32_SW; | ^~~~~~~~~ cc1: all warnings being treated as errors [175/3761] Compiling C object 'lib/76b5a35@@rte_hash at sta/hash_rte_cuckoo_hash.c.o'. FAILED: lib/76b5a35@@rte_hash at sta/hash_rte_cuckoo_hash.c.o ccache powerpc64le-linux-gnu-gcc -Ilib/76b5a35@@rte_hash at sta -Ilib -I../lib -Ilib/hash -I../lib/hash -I. -I../ -Iconfig -I../config -Ilib/eal/include -I../lib/eal/include -Ilib/eal/linux/include -I../lib/eal/linux/include -Ilib/eal/ppc/include -I../lib/eal/ppc/include -Ilib/eal/common -I../lib/eal/common -Ilib/eal -I../lib/eal -Ilib/kvargs -I../lib/kvargs -Ilib/telemetry/../metrics -I../lib/telemetry/../metrics -Ilib/telemetry -I../lib/telemetry -Ilib/net -I../lib/net -Ilib/mbuf -I../lib/mbuf -Ilib/mempool -I../lib/mempool -Ilib/ring -I../lib/ring -Ilib/rcu -I../lib/rcu -fdiagnostics-color=3Dalways -pipe -D_FILE_OFFSET_BITS=3D64 -Wall -Winvalid-pch -Wextra -Werror -O2 -g -include rte_config.h -Wcast-qual -Wdeprecated -Wformat -Wformat-nonliteral -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wsign-compare -Wstrict-prototypes -Wundef -Wwrite-strings -Wno-address-of-packed-member -Wno-packed-not-aligned -Wno-missing-field-initializers -D_GNU_SOURCE -fPIC -mcpu=3Dpower8 -mtune=3Dpower8 -DALLOW_EXPERIMENTAL_API -DALLOW_INTERNAL_API -Wno-format-truncation -DRTE_LOG_DEFAULT_LOGTYPE=3Dlib.hash -MD -MQ 'lib/76b5a35@@rte_hash at sta/hash_rte_cuckoo_hash.c.o' -MF 'lib/76b5a35@@rte_hash at sta/hash_rte_cuckoo_hash.c.o.d' -o 'lib/76b5a35@@rte_hash at sta/hash_rte_cuckoo_hash.c.o' -c ../lib/hash/rte_cuckoo_hash.c In file included from ../lib/hash/rte_cuckoo_hash.h:43, from ../lib/hash/rte_cuckoo_hash.c:32: ../lib/hash/rte_hash_crc.h:32:16: error: =E2=80=98crc32_alg=E2=80=99 define= d but not used [-Werror=3Dunused-variable] 32 | static uint8_t crc32_alg =3D CRC32_SW; | ^~~~~~~~~ cc1: all warnings being treated as errors [176/3761] Generating ethdev.sym_chk with a meson_exe.py custom command. ninja: build stopped: subcommand failed. ##[error]Process completed with exit code 1. --=20 David Marchand