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 F26C0A0548; Tue, 7 Jun 2022 19:17:55 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5360A4161A; Tue, 7 Jun 2022 19:17:52 +0200 (CEST) Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by mails.dpdk.org (Postfix) with ESMTP id 528CD40689 for ; Tue, 7 Jun 2022 19:17:51 +0200 (CEST) Received: by mail-pf1-f176.google.com with SMTP id z17so16071146pff.7 for ; Tue, 07 Jun 2022 10:17:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CzyOmQ0PGqXwHB3qtq8RSVp5/tnvlXr3wmul/vxIHSE=; b=LagwuS0s3G4zeTgVWplhPaPVWbLZoCKloJHjMsf/wOL0MMGKgv/u092A0jfh4JTNf9 o+JhKw0YNXxvvWbv4bFwGFdaYZv116x8dEk6VPAqkPoCfE7PCRi3h17vGoDM14ltCGx9 mCq6hGfGNwkdLI+xqmGamB6nhPyJYVSCbVEAosASc94HnEMBYLIl/7vyqlzkaIWFsBs1 5Y+srvBvE2Mm5y4eoFnEKqEwipHrDU9mRiCwZK/2Ko6xQdY3ybzfDi1ig4ktlO/l/X8F vXwnY8yJaLZfTlgHZML7FSvTz0UUNrIZx+UDwGQA4gkdygJ65ROb+iNyKvtplUMwiNXu E1Lw== 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=CzyOmQ0PGqXwHB3qtq8RSVp5/tnvlXr3wmul/vxIHSE=; b=CaOLCIe1Emn8UWEWql1s0LiB94++bIsSsqFRFEPdmBQeozHwwhdszs9Lz8WmJyBVMK R3OEeKXgH2nzveU6wtkq55SR9Pdvz2kTXMNYaNl3H+PP13MnCbCSw1Mrs84X3OqL0AA1 W3ejADRWWOzEdtLwaYlkqh4g6AxhIKpap9FTfXbse+gIrFlijK20ogQjtnkHy29w7g1q USRIwRgUb487SUMDgETqV/DjaHL6kcMzjlYvl5s8/nfFa5LkLzF+h50UxO1amLFUY/z/ Uk1Elsw7qP5POeWH/TQVwOaA+7gbr4vZGn3Cg2fmdKIKsdF/Ik+8kSetf8aZqg9BBHvr eL1g== X-Gm-Message-State: AOAM5301OzvM0BeldNBcMtFCrZzjsQNbIfwdmmCBk4u0tcobrtHv21nW 7D2ceV8bSWdePr1y4VYmTdHs/HdfQM4SZA== X-Google-Smtp-Source: ABdhPJy4/bpnc91p8Du8MqVlOpyy+ENYz8gYbTWSqZNb/bFAK+5POwzhEsCH4k9lOSKbpsiS9eMIpQ== X-Received: by 2002:a63:f242:0:b0:3fd:8a04:df6 with SMTP id d2-20020a63f242000000b003fd8a040df6mr13556815pgk.300.1654622270023; Tue, 07 Jun 2022 10:17:50 -0700 (PDT) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id x2-20020a627c02000000b005087c23ad8dsm13185281pfc.0.2022.06.07.10.17.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 10:17:49 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Marcin Wojtas , Michal Krawczyk , Shai Brandes , Evgeny Schemeilin , Igor Chauskin Subject: [RFC 1/8] net/ena: fix warnings related to rte_memcpy and gcc-12 Date: Tue, 7 Jun 2022 10:17:39 -0700 Message-Id: <20220607171746.461772-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220607171746.461772-1-stephen@networkplumber.org> References: <20220607171746.461772-1-stephen@networkplumber.org> 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 Rte_memcpy is not needed for small objects only used on control path. Regular memcpy is as fast or faster and there is more robust since static analysis etc knows what it does. In this driver it was redefining all memcpy as rte_memcpy which is even worse. Signed-off-by: Stephen Hemminger --- drivers/net/ena/base/ena_plat_dpdk.h | 10 +--------- drivers/net/ena/ena_ethdev.c | 8 ++++---- drivers/net/ena/ena_rss.c | 2 +- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/drivers/net/ena/base/ena_plat_dpdk.h b/drivers/net/ena/base/ena_plat_dpdk.h index 8f2b3a87c2ab..caea763e3eca 100644 --- a/drivers/net/ena/base/ena_plat_dpdk.h +++ b/drivers/net/ena/base/ena_plat_dpdk.h @@ -26,7 +26,6 @@ #include #include -#include typedef uint64_t u64; typedef uint32_t u32; @@ -67,14 +66,7 @@ typedef uint64_t dma_addr_t; #define ENA_UDELAY(x) rte_delay_us_block(x) #define ENA_TOUCH(x) ((void)(x)) -/* 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 + #define wmb rte_wmb #define rmb rte_rmb #define mb rte_mb diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c index 68768cab7077..5f87429606e6 100644 --- a/drivers/net/ena/ena_ethdev.c +++ b/drivers/net/ena/ena_ethdev.c @@ -481,7 +481,7 @@ ENA_PROXY_DESC(ena_com_get_dev_basic_stats, ENA_MP_DEV_STATS_GET, ENA_TOUCH(rsp); ENA_TOUCH(ena_dev); if (stats != &adapter->basic_stats) - rte_memcpy(stats, &adapter->basic_stats, sizeof(*stats)); + memcpy(stats, &adapter->basic_stats, sizeof(*stats)); }), struct ena_com_dev *ena_dev, struct ena_admin_basic_stats *stats); @@ -496,7 +496,7 @@ ENA_PROXY_DESC(ena_com_get_eni_stats, ENA_MP_ENI_STATS_GET, ENA_TOUCH(rsp); ENA_TOUCH(ena_dev); if (stats != (struct ena_admin_eni_stats *)&adapter->eni_stats) - rte_memcpy(stats, &adapter->eni_stats, sizeof(*stats)); + memcpy(stats, &adapter->eni_stats, sizeof(*stats)); }), struct ena_com_dev *ena_dev, struct ena_admin_eni_stats *stats); @@ -538,8 +538,8 @@ ENA_PROXY_DESC(ena_com_indirect_table_get, ENA_MP_IND_TBL_GET, ENA_TOUCH(rsp); ENA_TOUCH(ena_dev); if (ind_tbl != adapter->indirect_table) - rte_memcpy(ind_tbl, adapter->indirect_table, - sizeof(adapter->indirect_table)); + memcpy(ind_tbl, adapter->indirect_table, + sizeof(adapter->indirect_table)); }), struct ena_com_dev *ena_dev, u32 *ind_tbl); diff --git a/drivers/net/ena/ena_rss.c b/drivers/net/ena/ena_rss.c index b6c4f76e3820..c723d3f5fca1 100644 --- a/drivers/net/ena/ena_rss.c +++ b/drivers/net/ena/ena_rss.c @@ -59,7 +59,7 @@ void ena_rss_key_fill(void *key, size_t size) key_generated = true; } - rte_memcpy(key, default_key, size); + memcpy(key, default_key, size); } int ena_rss_reta_update(struct rte_eth_dev *dev, -- 2.35.1