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 7ADD8A00C3 for ; Sat, 15 Jan 2022 23:13:47 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6A5954013F; Sat, 15 Jan 2022 23:13:47 +0100 (CET) Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) by mails.dpdk.org (Postfix) with ESMTP id 732FD4013F for ; Sat, 15 Jan 2022 23:13:46 +0100 (CET) Received: by mail-pf1-f175.google.com with SMTP id 128so6129572pfe.12 for ; Sat, 15 Jan 2022 14:13:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Y06SJ8RHviP4jitV22C7OXICLm+9i+PxZN4v6YEWs6s=; b=p1niUigDUa6/Hg9F8/1G9QgXwFXoW1X7hqzvhnchGnR/h5nQQxINlDbbMPGPF3yRWO a+Odm0O0JDosVYoMjO4QE6pI/YoeHiC/n8Yj0lA8QJeyiTfWl98Nw3d6k1vJ5iU1ZANV 9m+x6Ou0RWfBwjRv7cgO47/M0RXIdcLUEhCY9paviB9MBBzyJOugY6lQ4M10gpUBEw1u aEtDlIc5pL2TzaYyMfKIfX2jeA7xQacIkShxGNUF97+aNaybVQmdPbWCmcCtDUcA7Cq2 3XR+5EuB52Yq/POiLcSWL9nPCNfNOyHB9imQzqyvMKYwEwUFy5HHUuh26BJFe+LXwIaO XsIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Y06SJ8RHviP4jitV22C7OXICLm+9i+PxZN4v6YEWs6s=; b=nHkrKlCuso77UcPxWhFw0qqIhXVp7/Th3BTo2HOFOyvbJRyt7vtL8U53xsHeAR6XDU gG0dM4clu8VHhqNjKheV2dkoKRSxLvqRP989ZzTrq0xCRviHLSNwjuD+PoPFiHfdjd7C LP5lTI8W7xSotGPUV/xkL3T87gfAjdfCQMo/X2WjkPeIxLdCdtqueh0M88WSAeNbv7zi Bzg0Ry5YSH2F9rOabkJ9QOJY4tfDR4FhzZ7Wr8icDMngojieSP8To5IAug4+qPzIV276 vrjHjKel+q5zM+Rgkz3Vw9WzDjPpkkj1y+R1elXM3MqXArJm0P0t8enYWfkg0C/sEmyU w9YA== X-Gm-Message-State: AOAM533FFjMEamCGZfVFtAkRMD2ujeLLsue11VroIoLZDILrYfXu0+8H 7sdFF9gFMyfwQAeh/Ji/FCHMTQ== X-Google-Smtp-Source: ABdhPJz5o9dXQNmQBrPp5ZmdqZPAdOD2DHc9vuQIdmsyLozUveLl9JAejnCq6GgO+0YH7s5icDm9Lw== X-Received: by 2002:a05:6a00:1a86:b0:4c1:3039:16a6 with SMTP id e6-20020a056a001a8600b004c1303916a6mr15022638pfv.5.1642284825582; Sat, 15 Jan 2022 14:13:45 -0800 (PST) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id q8sm9857171pfl.194.2022.01.15.14.13.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Jan 2022 14:13:45 -0800 (PST) Date: Sat, 15 Jan 2022 14:13:42 -0800 From: Stephen Hemminger To: Luc Pelletier Cc: bruce.richardson@intel.com, konstantin.ananyev@intel.com, dev@dpdk.org, Xiaoyun Li , stable@dpdk.org Subject: Re: [PATCH v2] eal: fix unaligned loads/stores in rte_memcpy_generic Message-ID: <20220115141342.396a5f3a@hermes.local> In-Reply-To: <20220115213949.449313-1-lucp.at.work@gmail.com> References: <20220115194102.444140-1-lucp.at.work@gmail.com> <20220115213949.449313-1-lucp.at.work@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On Sat, 15 Jan 2022 16:39:50 -0500 Luc Pelletier wrote: > diff --git a/lib/eal/x86/include/rte_memcpy.h b/lib/eal/x86/include/rte_memcpy.h > index 1b6c6e585f..e422397e49 100644 > --- a/lib/eal/x86/include/rte_memcpy.h > +++ b/lib/eal/x86/include/rte_memcpy.h > @@ -45,6 +45,23 @@ extern "C" { > static __rte_always_inline void * > rte_memcpy(void *dst, const void *src, size_t n); > > +/** > + * Copy bytes from one location to another, > + * locations should not overlap. > + * Use with unaligned src/dst, and n <= 15. > + */ > +static __rte_always_inline void * > +rte_mov15_or_less_unaligned(void *dst, const void *src, size_t n) > +{ > + void *ret = dst; > + for (; n; n--) { > + *((char *)dst) = *((const char *) src); > + dst = ((char *)dst) + 1; > + src = ((const char *)src) + 1; > + } > + return ret; > +} X86 always allows unaligned access. Irregardless of what tools say. Why impose additional overhead in performance critical code.