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 AA0E8A0542; Mon, 29 Aug 2022 14:18:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 45A954069D; Mon, 29 Aug 2022 14:18:58 +0200 (CEST) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id CE8544003C for ; Mon, 29 Aug 2022 14:18:56 +0200 (CEST) Content-class: urn:content-classes:message Subject: RE: [PATCH] x86: rte_mov256 was missing for AVX2 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Date: Mon, 29 Aug 2022 14:18:55 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.5 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D872CB@smartserver.smartshare.dk> In-Reply-To: <10793250.BaYr0rKQ5T@thomas> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH] x86: rte_mov256 was missing for AVX2 Thread-Index: Adi7leNdAJyO4qocRSG4nAojtWYMVgACAdEg References: <20220820103032.119741-1-mb@smartsharesystems.com> <10793250.BaYr0rKQ5T@thomas> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Thomas Monjalon" Cc: , , 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 > From: Thomas Monjalon [mailto:thomas@monjalon.net] > Sent: Monday, 29 August 2022 12.56 >=20 > 20/08/2022 12:30, Morten Br=F8rup: > > The rte_mov256 function was missing for AVX2. > > Does nobody build test for AVX2 and check the compiler output? >=20 > Please could you specify the context/setup to reproduce the issue? I stumbled upon it while working on the new non-temporal memcpy = function. Reproduction described below. >=20 > An error message would be nice to paste here as well. > Thanks The rte_memcpy declarations are in the lib/eal/generic/rte_memcpy.h = header file, so add this declaration header file to the implementation = file. (I wonder why it is not already there?) lib/eal/x86/rte_memcpy.h: #include #include #include + #include "generic/rte_memcpy.h" #ifdef __cplusplus extern "C" { #endif The error messages from ninja look like this: [46/2597] Compiling C object lib/acl/libavx2_tmp.a.p/acl_run_avx2.c.o In file included from ../lib/eal/x86/include/rte_memcpy.h:24, from ../lib/acl/rte_acl_osdep.h:40, from ../lib/acl/rte_acl.h:14, from ../lib/acl/acl_run.h:8, from ../lib/acl/acl_run_sse.h:5, from ../lib/acl/acl_run_avx2.h:5, from ../lib/acl/acl_run_avx2.c:6: ../lib/eal/include/generic/rte_memcpy.h:89:1: warning: 'rte_mov256' = declared 'static' but never defined [-Wunused-function] 89 | rte_mov256(uint8_t *dst, const uint8_t *src); | ^~~~~~~~~~ [52/2597] Compiling C object = lib/acl/libavx512_tmp.a.p/acl_run_avx512.c.o In file included from ../lib/eal/x86/include/rte_memcpy.h:24, from ../lib/acl/rte_acl_osdep.h:40, from ../lib/acl/rte_acl.h:14, from ../lib/acl/acl_run.h:8, from ../lib/acl/acl_run_sse.h:5, from ../lib/acl/acl_run_avx512.c:5: ../lib/eal/include/generic/rte_memcpy.h:89:1: warning: 'rte_mov256' = declared 'static' but never defined [-Wunused-function] 89 | rte_mov256(uint8_t *dst, const uint8_t *src); | ^~~~~~~~~~ At SmartShare Systems we follow a coding convention of including the = declaration header file at the absolute top of the file implementing it. = This reveals at build time if anything is missing in the declaration = header file. The DPDK Project could do the same, and find bugs like = this. Here's an example: foo.h: ------ // Declaration static inline uint32_t bar(uint32_t x); foo.c: ------ #include // <-- Note: At the absolute top! #include // Implementation static inline uint32_t bar(uint32_t x) { return x * 2; } Following our coding convention will reveal that is required = for using , and thus should be included in foo.h (not in foo.c) - = because someone else might include , and then could be = missing there. -Morten