DPDK patches and discussions
 help / color / mirror / Atom feed
From: Wathsala Wathawana Vithanage <wathsala.vithanage@arm.com>
To: Stephen Hemminger <stephen@networkplumber.org>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: Shai Brandes <shaibran@amazon.com>,
	Evgeny Schemeilin <evgenys@amazon.com>,
	Ron Beider <rbeider@amazon.com>,
	Amit Bernstein <amitbern@amazon.com>,
	Wajeeh Atrash <atrwajee@amazon.com>,
	Igor Chauskin <igorch@amazon.com>,
	Michal Krawczyk <mk@semihalf.com>, Artur Rojek <ar@semihalf.com>,
	nd <nd@arm.com>
Subject: RE: [PATCH] net/ena: revert redefining memcpy
Date: Mon, 12 Aug 2024 20:53:39 +0000	[thread overview]
Message-ID: <PR3PR08MB5850D003E98EE6517A1C04B89F852@PR3PR08MB5850.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <20240812153417.65225-1-stephen@networkplumber.org>


> Subject: [PATCH] net/ena: revert redefining memcpy
> 
> Redefining memcpy as rte_memcpy has no performance gain on current
> compilers, and introduced bugs like this one where
> rte_memcpy() will be detected as referencing past the destination.
> 
> Bugzilla ID: 1510
> Fixes: 142778b3702a ("net/ena: switch memcpy to optimized version")

Similar observations in Arm when RTE_ARCH_ARM64_MEMCPY flag is on.

Acked-by: Wathsala Vithanage <wathsala.vithanage@arm.com>

> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>  drivers/net/ena/base/ena_plat_dpdk.h | 9 +--------
>  1 file changed, 1 insertion(+), 8 deletions(-)
> 
> diff --git a/drivers/net/ena/base/ena_plat_dpdk.h
> b/drivers/net/ena/base/ena_plat_dpdk.h
> index 21b96113c7..291db6cabe 100644
> --- a/drivers/net/ena/base/ena_plat_dpdk.h
> +++ b/drivers/net/ena/base/ena_plat_dpdk.h
> @@ -26,7 +26,6 @@
>  #include <rte_spinlock.h>
> 
>  #include <sys/time.h>
> -#include <rte_memcpy.h>
> 
>  typedef uint64_t u64;
>  typedef uint32_t u32;
> @@ -70,13 +69,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
> --
> 2.43.0


  reply	other threads:[~2024-08-12 20:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200~bug-1510-3@http.bugs.dpdk.org>
2024-08-12 15:34 ` Stephen Hemminger
2024-08-12 20:53   ` Wathsala Wathawana Vithanage [this message]
2024-08-13  8:57   ` Morten Brørup
2024-09-12  5:12   ` Tyler Retzlaff
2024-09-12  8:19     ` Ferruh Yigit
2024-09-12 14:53       ` Brandes, Shai
2024-09-16  6:33       ` Brandes, Shai
2024-09-16 15:11         ` Stephen Hemminger
2024-09-16 16:06           ` Brandes, Shai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=PR3PR08MB5850D003E98EE6517A1C04B89F852@PR3PR08MB5850.eurprd08.prod.outlook.com \
    --to=wathsala.vithanage@arm.com \
    --cc=amitbern@amazon.com \
    --cc=ar@semihalf.com \
    --cc=atrwajee@amazon.com \
    --cc=dev@dpdk.org \
    --cc=evgenys@amazon.com \
    --cc=igorch@amazon.com \
    --cc=mk@semihalf.com \
    --cc=nd@arm.com \
    --cc=rbeider@amazon.com \
    --cc=shaibran@amazon.com \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).