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 0DDA94414A; Mon, 3 Jun 2024 19:04:55 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EC2E542E5D; Mon, 3 Jun 2024 19:04:54 +0200 (CEST) Received: from mail.lysator.liu.se (mail.lysator.liu.se [130.236.254.3]) by mails.dpdk.org (Postfix) with ESMTP id A556A42E4A for ; Mon, 3 Jun 2024 19:04:52 +0200 (CEST) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 46D091E832 for ; Mon, 3 Jun 2024 19:04:52 +0200 (CEST) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id 3AEB31E7AD; Mon, 3 Jun 2024 19:04:52 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on hermod.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=ALL_TRUSTED,AWL, T_SCC_BODY_TEXT_LINE autolearn=disabled version=4.0.0 X-Spam-Score: -1.3 Received: from [192.168.1.59] (h-62-63-215-114.A163.priv.bahnhof.se [62.63.215.114]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 0C5891E6F9; Mon, 3 Jun 2024 19:04:49 +0200 (CEST) Message-ID: Date: Mon, 3 Jun 2024 19:04:49 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC v3 5/5] eal: provide option to use compiler memcpy instead of RTE To: =?UTF-8?Q?Morten_Br=C3=B8rup?= , =?UTF-8?Q?Mattias_R=C3=B6nnblom?= , dev@dpdk.org Cc: Stephen Hemminger , Abdullah Sevincer , Pavan Nikhilesh , David Hunt , Vladimir Medvedkin References: <20240528074354.190779-1-mattias.ronnblom@ericsson.com> <20240602123921.363625-1-mattias.ronnblom@ericsson.com> <20240602123921.363625-6-mattias.ronnblom@ericsson.com> <98CBD80474FA8B44BF855DF32C47DC35E9F4E7@smartserver.smartshare.dk> Content-Language: en-US From: =?UTF-8?Q?Mattias_R=C3=B6nnblom?= In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35E9F4E7@smartserver.smartshare.dk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP 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 2024-06-02 22:58, Morten Brørup wrote: >> From: Mattias Rönnblom [mailto:mattias.ronnblom@ericsson.com] >> Sent: Sunday, 2 June 2024 14.39 >> >> Provide build option to have functions in delegate to >> the standard compiler/libc memcpy(), instead of using the various >> custom DPDK, handcrafted, per-architecture rte_memcpy() >> implementations. >> >> A new meson build option 'use_cc_memcpy' is added. By default, >> the compiler/libc memcpy() is used. >> >> The performance benefits of the custom DPDK rte_memcpy() >> implementations have been diminishing with every compiler release, and >> with current toolchains the usage of a custom memcpy() implementation >> may even be a liability. >> >> An additional benefit of this change is that compilers and static >> analysis tools have an easier time detecting incorrect usage of >> memcpy() (e.g., buffer overruns, or overlapping source and destination >> buffers). >> >> This patch makes DPDK and DPDK applications using use >> compiler/libc memcpy() by default, but leaves an option to stay on the >> custom DPDK implementations, would that prove beneficial for certain >> applications or architectures. >> >> RFC v3: >> o Fix missing #endif on loongarch. >> o PPC and RISCV now implemented, meaning all architectures are >> supported. >> o Unnecessary include is removed from . >> >> RFC v2: >> * Fix bug where rte_memcpy.h was not installed on x86. >> * Made attempt to make Loongarch compile. >> >> Signed-off-by: Mattias Rönnblom >> --- > > We should keep pushing DPDK forward and cleaning up old cruft along the way. > > The memcpy discussion has convinced me that: > 1. This change is a good idea, and > 2. Mainstream compilers are sufficiently mature to do it now. > > So, for the series, > Acked-by: Morten Brørup > >> static inline void >> rte_mov32(uint8_t *dst, const uint8_t *src); > > While at it, would it be somehow beneficial to change these from uint8_t* to void* or char* (keeping const where relevant)? > Something to consider before doing such a change would be if it may cause any strict aliasing issue for existing users. If we should break the API, I think we are better off removing rte_mov*() altogether.