Skip to content

Commit

Permalink
net/ena: revert redefining memcpy
Browse files Browse the repository at this point in the history
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: 142778b ("net/ena: switch memcpy to optimized version")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Wathsala Vithanage <wathsala.vithanage@arm.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Acked-by: Shai Brandes <shaibran@amazon.com>
  • Loading branch information
shemminger authored and ferruhy committed Sep 22, 2024
1 parent cf4e370 commit 177572d
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions drivers/net/ena/base/ena_plat_dpdk.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include <rte_spinlock.h>

#include <sys/time.h>
#include <rte_memcpy.h>

typedef uint64_t u64;
typedef uint32_t u32;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 177572d

Please sign in to comment.