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 CC0B9A034C; Wed, 23 Feb 2022 13:21:20 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EDD844270E; Wed, 23 Feb 2022 13:20:44 +0100 (CET) Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) by mails.dpdk.org (Postfix) with ESMTP id 4038F426F4 for ; Wed, 23 Feb 2022 13:20:41 +0100 (CET) Received: by mail-ed1-f47.google.com with SMTP id m3so37886194eda.10 for ; Wed, 23 Feb 2022 04:20:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4VKPrFiWyx32d8z/papoVusrUqw07DPcSQLxx3bCRbw=; b=6PMRUP6ZpZWVI0ZDA2zUDnSTA3Bcvn3y0rJ0Y5OMznZcmbaeLPNhkkcNXZeT3x+Jkx uq9DB/SKkDi6u03iZd4DDGfkj1JYJNexZ41uV1yBXcnnxrRgrsnOkt/nHoEKBF1Lgr0J r4PKYPk8hkL2ZiKDVnIK2QnjWr3LHsvr41zTvcnFNofTYMWiQlml1OO0njVQJwE6WOMD EtkR6C9RyNcXDtxt8bKKr4be1b0Q87TlTnEXDz1ZlNKbMlm3UpPHVfXjwo+wCh3yzK82 FrmlMEDGElTIPQUHWb2/9epoexkyxQZj64A3Tx6tdeHg+S9CrRzKz41bFVIfxinHNgTt 5ewg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4VKPrFiWyx32d8z/papoVusrUqw07DPcSQLxx3bCRbw=; b=qZ5WEanQICAfbxsqEhTP9kFYf/ky5SFmgBmFgbUT3ErvJmnkrECBDs7PdzhkREVxd3 AKZUGak3QuHNCYjdjHLz7zEluPCLKwE7XoQqh1/OKUlSN0iyDLinPgvclxtdlUvbM7YU ii0DEJhgw4godNmZ1oO3l7Qye//aJcDRQagsWuEbQidqYrT1iogrhe+vZDoSB8kL18A0 VcYf2VXFgov3jglLCgmWUStTj5Kywxml84i7Aj5CitM5q6TQ9YClHWPVVIEgd920bsL+ 6T0g26dJQ5Jo4xRzBAUX0+s+xHbzAaO0y+TL9BeYkLB2bGy9OXsNmetZN/LMBKtwxPON USYw== X-Gm-Message-State: AOAM532uP8luZTM/dkwAq08Bp3X15rDnQZrnbrK/nejYz+x3atJdEUF2 9b3N4OY74uDFoCsVm3xOfJbmYBi5eGU8+Q== X-Google-Smtp-Source: ABdhPJyJmJ8bEPpD683uc6Zz2HUIOulc10/ZMK2tGeVQDqGateZyQcWYFCMCxQ40EqJ1qzbE7kigsQ== X-Received: by 2002:a05:6402:845:b0:412:ad14:863e with SMTP id b5-20020a056402084500b00412ad14863emr30166713edz.380.1645618840687; Wed, 23 Feb 2022 04:20:40 -0800 (PST) Received: from DESKTOP-U5LNN3J.localdomain (89-79-181-52.dynamic.chello.pl. [89.79.181.52]) by smtp.gmail.com with ESMTPSA id v12sm11629224edr.8.2022.02.23.04.20.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Feb 2022 04:20:40 -0800 (PST) From: Michal Krawczyk To: dev@dpdk.org Cc: ferruh.yigit@intel.com, shaibran@amazon.com, upstream@semihalf.com, Michal Krawczyk , Dawid Gorecki Subject: [PATCH v3 09/21] net/ena/base: use optimized memcpy version also on Arm Date: Wed, 23 Feb 2022 13:19:32 +0100 Message-Id: <20220223121944.24156-10-mk@semihalf.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220223121944.24156-1-mk@semihalf.com> References: <20220222181146.28882-1-mk@semihalf.com> <20220223121944.24156-1-mk@semihalf.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 As the default behavior for arm64 is to alias rte_memcpy as memcpy, ENA cannot redefine memcpy as rte_memcpy as it would cause nested declaration. To make it possible to use optimized memcpy in the ena_com layer on Arm, the driver now redefines memcpy when it is beneficial: * For arm64 only when the flag RTE_ARCH_ARM64_MEMCPY was defined * For arm only when the flag RTE_ARCH_ARM_NEON_MEMCPY was defined Signed-off-by: Michal Krawczyk Reviewed-by: Dawid Gorecki Reviewed-by: Shai Brandes --- doc/guides/rel_notes/release_22_03.rst | 1 + drivers/net/ena/base/ena_plat_dpdk.h | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/guides/rel_notes/release_22_03.rst b/doc/guides/rel_notes/release_22_03.rst index c8e38d4c70..92490afd60 100644 --- a/doc/guides/rel_notes/release_22_03.rst +++ b/doc/guides/rel_notes/release_22_03.rst @@ -112,6 +112,7 @@ New Features * Added new checksum related xstats: ``l3_csum_bad``, ``l4_csum_bad`` and ``l4_csum_good``. * Added support for the link status configuration. + * Added optimized memcpy support for the ARM platforms. * **Updated Cisco enic driver.** diff --git a/drivers/net/ena/base/ena_plat_dpdk.h b/drivers/net/ena/base/ena_plat_dpdk.h index 4e7f52881a..41db883c63 100644 --- a/drivers/net/ena/base/ena_plat_dpdk.h +++ b/drivers/net/ena/base/ena_plat_dpdk.h @@ -66,8 +66,11 @@ typedef uint64_t dma_addr_t; #define ENA_UDELAY(x) rte_delay_us_block(x) #define ENA_TOUCH(x) ((void)(x)) -/* Avoid nested declaration on arm64, as it may define rte_memcpy as memcpy. */ -#if defined(RTE_ARCH_X86) +/* Redefine memcpy with caution: rte_memcpy can be simply aliased to memcpy, so + * make the redefinition only if it's safe (and beneficial) to do so. + */ +#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64_MEMCPY) || \ + defined(RTE_ARCH_ARM_NEON_MEMCPY) #undef memcpy #define memcpy rte_memcpy #endif -- 2.25.1