#include "testpmd.h"
#if defined(RTE_ARCH_X86)
#include "macswap_sse.h"
-#elif defined(RTE_MACHINE_CPUFLAG_NEON)
+#elif defined(__ARM_NEON)
#include "macswap_neon.h"
#else
#include "macswap.h"
#define TEST_BATCH_SIZE 100
/* Data is aligned on this many bytes (power of 2) */
-#ifdef RTE_MACHINE_CPUFLAG_AVX512F
+#ifdef __AVX512F__
#define ALIGNMENT_UNIT 64
-#elif defined RTE_MACHINE_CPUFLAG_AVX2
+#elif defined __AVX2__
#define ALIGNMENT_UNIT 32
-#else /* RTE_MACHINE_CPUFLAG */
+#else
#define ALIGNMENT_UNIT 16
-#endif /* RTE_MACHINE_CPUFLAG */
+#endif
/*
* Pointers used in performance tests. The two large buffers are for uncached
if (cc.get_define('__ARM_NEON', args: machine_args) != '' or
cc.get_define('__aarch64__', args: machine_args) != '')
- dpdk_conf.set('RTE_MACHINE_CPUFLAG_NEON', 1)
compile_time_cpuflags += ['RTE_CPUFLAG_NEON']
endif
if cc.get_define('__ARM_FEATURE_CRC32', args: machine_args) != ''
- dpdk_conf.set('RTE_MACHINE_CPUFLAG_CRC32', 1)
compile_time_cpuflags += ['RTE_CPUFLAG_CRC32']
endif
if cc.get_define('__ARM_FEATURE_CRYPTO', args: machine_args) != ''
- dpdk_conf.set('RTE_MACHINE_CPUFLAG_AES', 1)
- dpdk_conf.set('RTE_MACHINE_CPUFLAG_PMULL', 1)
- dpdk_conf.set('RTE_MACHINE_CPUFLAG_SHA1', 1)
- dpdk_conf.set('RTE_MACHINE_CPUFLAG_SHA2', 1)
compile_time_cpuflags += ['RTE_CPUFLAG_AES', 'RTE_CPUFLAG_PMULL',
'RTE_CPUFLAG_SHA1', 'RTE_CPUFLAG_SHA2']
endif
dpdk_conf.set('RTE_MAX_LCORE', 1536)
dpdk_conf.set('RTE_MAX_NUMA_NODES', 32)
dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
-dpdk_conf.set('RTE_MACHINE_CPUFLAG_ALTIVEC', 1)
-dpdk_conf.set('RTE_MACHINE_CPUFLAG_VSX', 1)
base_flags = ['SSE', 'SSE2', 'SSE3','SSSE3', 'SSE4_1', 'SSE4_2']
foreach f:base_flags
- dpdk_conf.set('RTE_MACHINE_CPUFLAG_' + f, 1)
compile_time_cpuflags += ['RTE_CPUFLAG_' + f]
endforeach
elif f == 'RDRND'
f = 'RDRAND'
endif
- dpdk_conf.set('RTE_MACHINE_CPUFLAG_' + f, 1)
compile_time_cpuflags += ['RTE_CPUFLAG_' + f]
endif
endforeach
Along with compiler optimizations,
a set of preprocessor defines are automatically added to the build process (regardless of the compiler version).
These defines correspond to the instruction sets that the target CPU should be able to support.
-For example, a binary compiled for any SSE4.2-capable processor will have RTE_MACHINE_CPUFLAG_SSE4_2 defined,
-thus enabling compile-time code path selection for different platforms.
can be got using the ``pip``, or ``pip3``, tool for downloading python
packages.
-* build macros: The macros defining RTE_MACHINE_CPUFLAG_* will be removed
- from the build. The information provided by these macros is available
- through standard compiler macros. For example, RTE_MACHINE_CPUFLAG_SSE3
- duplicates the compiler-provided macro __SSE3__.
-
* kvargs: The function ``rte_kvargs_process`` will get a new parameter
for returning key match count. It will ease handling of no-match case.
Also, make sure to start the actual text at the margin.
=======================================================
+* build macros: The macros defining ``RTE_MACHINE_CPUFLAG_*`` are removed.
+ The information provided by these macros is available through standard
+ compiler macros.
+
* eal: The ``rte_logs`` struct and global symbol was made private
and is no longer part of the API.
includes += include_directories('base')
# The current implementation assumes 64-bit pointers
-if dpdk_conf.has('RTE_MACHINE_CPUFLAG_AVX2') and dpdk_conf.get('RTE_ARCH_64')
+if cc.get_define('__AVX2__', args: machine_args) != '' and dpdk_conf.get('RTE_ARCH_64')
sources += files('enic_rxtx_vec_avx2.c')
# Build the avx2 handler if the compiler supports it, even though 'machine'
# does not. This is to support users who build for the min supported machine
# compile AVX2 version if either:
# a. we have AVX supported in minimum instruction set baseline
# b. it's not minimum instruction set, but supported by compiler
- if dpdk_conf.has('RTE_MACHINE_CPUFLAG_AVX2')
+ if cc.get_define('__AVX2__', args: machine_args) != ''
cflags += ['-DCC_AVX2_SUPPORT']
sources += files('i40e_rxtx_vec_avx2.c')
elif cc.has_argument('-mavx2')
# compile AVX2 version if either:
# a. we have AVX supported in minimum instruction set baseline
# b. it's not minimum instruction set, but supported by compiler
- if dpdk_conf.has('RTE_MACHINE_CPUFLAG_AVX2')
+ if cc.get_define('__AVX2__', args: machine_args) != ''
cflags += ['-DCC_AVX2_SUPPORT']
sources += files('iavf_rxtx_vec_avx2.c')
elif cc.has_argument('-mavx2')
# compile AVX2 version if either:
# a. we have AVX supported in minimum instruction set baseline
# b. it's not minimum instruction set, but supported by compiler
- if dpdk_conf.has('RTE_MACHINE_CPUFLAG_AVX2')
+ if cc.get_define('__AVX2__', args: machine_args) != ''
sources += files('ice_rxtx_vec_avx2.c')
elif cc.has_argument('-mavx2')
ice_avx2_lib = static_library('ice_avx2_lib',
dev->rx_pkt_burst == ixgbe_recv_pkts_bulk_alloc)
return ptypes;
-#if defined(RTE_ARCH_X86) || defined(RTE_MACHINE_CPUFLAG_NEON)
+#if defined(RTE_ARCH_X86) || defined(__ARM_NEON)
if (dev->rx_pkt_burst == ixgbe_recv_pkts_vec ||
dev->rx_pkt_burst == ixgbe_recv_scattered_pkts_vec)
return ptypes;
#define RTE_LOGTYPE_L3FWD RTE_LOGTYPE_USER1
-#if !defined(NO_HASH_MULTI_LOOKUP) && defined(RTE_MACHINE_CPUFLAG_NEON)
+#if !defined(NO_HASH_MULTI_LOOKUP) && defined(__ARM_NEON)
#define NO_HASH_MULTI_LOOKUP 1
#endif
#include "l3fwd.h"
#include "l3fwd_event.h"
-#if defined(RTE_ARCH_X86) || defined(RTE_MACHINE_CPUFLAG_CRC32)
+#if defined(RTE_ARCH_X86) || defined(__ARM_FEATURE_CRC32)
#define EM_HASH_CRC 1
#endif
static rte_xmm_t mask1;
static rte_xmm_t mask2;
-#if defined(RTE_MACHINE_CPUFLAG_SSE2)
+#if defined(__SSE2__)
static inline xmm_t
em_mask_key(void *key, xmm_t mask)
{
return _mm_and_si128(data, mask);
}
-#elif defined(RTE_MACHINE_CPUFLAG_NEON)
+#elif defined(__ARM_NEON)
static inline xmm_t
em_mask_key(void *key, xmm_t mask)
{
return vandq_s32(data, mask);
}
-#elif defined(RTE_MACHINE_CPUFLAG_ALTIVEC)
+#elif defined(__ALTIVEC__)
static inline xmm_t
em_mask_key(void *key, xmm_t mask)
{
return (ret < 0) ? portid : ipv6_l3fwd_out_if[ret];
}
-#if defined RTE_ARCH_X86 || defined RTE_MACHINE_CPUFLAG_NEON
+#if defined RTE_ARCH_X86 || defined __ARM_NEON
#if defined(NO_HASH_MULTI_LOOKUP)
#include "l3fwd_em_sequential.h"
#else
if (nb_rx == 0)
continue;
-#if defined RTE_ARCH_X86 || defined RTE_MACHINE_CPUFLAG_NEON
+#if defined RTE_ARCH_X86 || defined __ARM_NEON
l3fwd_em_send_packets(nb_rx, pkts_burst,
portid, qconf);
#else
struct rte_mbuf *mbuf = ev.mbuf;
-#if defined RTE_ARCH_X86 || defined RTE_MACHINE_CPUFLAG_NEON
+#if defined RTE_ARCH_X86 || defined __ARM_NEON
mbuf->port = em_get_dst_port(lconf, mbuf, mbuf->port);
process_packet(mbuf, &mbuf->port);
#else
continue;
}
-#if defined RTE_ARCH_X86 || defined RTE_MACHINE_CPUFLAG_NEON
+#if defined RTE_ARCH_X86 || defined __ARM_NEON
l3fwd_em_process_events(nb_deq, (struct rte_event **)&events,
lconf);
#else
#if defined RTE_ARCH_X86
#include "l3fwd_sse.h"
#include "l3fwd_em_hlm_sse.h"
-#elif defined RTE_MACHINE_CPUFLAG_NEON
+#elif defined __ARM_NEON
#include "l3fwd_neon.h"
#include "l3fwd_em_hlm_neon.h"
#endif
#if defined RTE_ARCH_X86
#include "l3fwd_sse.h"
-#elif defined RTE_MACHINE_CPUFLAG_NEON
+#elif defined __ARM_NEON
#include "l3fwd_neon.h"
#endif
#if defined(RTE_ARCH_X86)
#include "l3fwd_lpm_sse.h"
-#elif defined RTE_MACHINE_CPUFLAG_NEON
+#elif defined __ARM_NEON
#include "l3fwd_lpm_neon.h"
#elif defined(RTE_ARCH_PPC_64)
#include "l3fwd_lpm_altivec.h"
if (nb_rx == 0)
continue;
-#if defined RTE_ARCH_X86 || defined RTE_MACHINE_CPUFLAG_NEON \
+#if defined RTE_ARCH_X86 || defined __ARM_NEON \
|| defined RTE_ARCH_PPC_64
l3fwd_lpm_send_packets(nb_rx, pkts_burst,
portid, qconf);
{
mbuf->port = lpm_get_dst_port(lconf, mbuf, mbuf->port);
-#if defined RTE_ARCH_X86 || defined RTE_MACHINE_CPUFLAG_NEON \
+#if defined RTE_ARCH_X86 || defined __ARM_NEON \
|| defined RTE_ARCH_PPC_64
process_packet(mbuf, &mbuf->port);
#else
# in former case, just add avx2 C file to files list
# in latter case, compile c file to static lib, using correct compiler
# flags, and then have the .o file from static lib linked into main lib.
- if dpdk_conf.has('RTE_MACHINE_CPUFLAG_AVX2')
+ if cc.get_define('__AVX2__', args: machine_args) != ''
sources += files('acl_run_avx2.c')
cflags += '-DCC_AVX2_SUPPORT'
elif cc.has_argument('-mavx2')
#ifdef RTE_ARCH_ARM_NEON_MEMCPY
-#ifndef RTE_MACHINE_CPUFLAG_NEON
+#ifndef __ARM_NEON
#error "Cannot optimize memcpy by NEON as the CPU seems to not support this"
#endif
* Copyright(c) 2019 Ericsson AB
*/
-#ifdef RTE_MACHINE_CPUFLAG_RDSEED
+#ifdef __RDSEED__
#include <x86intrin.h>
#endif
#include <stdlib.h>
if (ge_rc == 0)
return ge_seed;
#endif
-#ifdef RTE_MACHINE_CPUFLAG_RDSEED
+#ifdef __RDSEED__
unsigned int rdseed_low;
unsigned int rdseed_high;
static __rte_always_inline void *
rte_memcpy(void *dst, const void *src, size_t n);
-#ifdef RTE_MACHINE_CPUFLAG_AVX512F
+#ifdef __AVX512F__
#define ALIGNMENT_MASK 0x3F
goto COPY_BLOCK_128_BACK63;
}
-#elif defined RTE_MACHINE_CPUFLAG_AVX2
+#elif defined __AVX2__
#define ALIGNMENT_MASK 0x1F
goto COPY_BLOCK_128_BACK31;
}
-#else /* RTE_MACHINE_CPUFLAG */
+#else /* __AVX512F__ */
#define ALIGNMENT_MASK 0x0F
goto COPY_BLOCK_64_BACK15;
}
-#endif /* RTE_MACHINE_CPUFLAG */
+#endif /* __AVX512F__ */
static __rte_always_inline void *
rte_memcpy_aligned(void *dst, const void *src, size_t n)
const efd_lookuptbl_t *group_lookup_table,
const uint32_t hash_val_a, const uint32_t hash_val_b)
{
-#ifdef RTE_MACHINE_CPUFLAG_AVX2
+#ifdef __AVX2__
efd_value_t value = 0;
uint32_t i = 0;
__m256i vhash_val_a = _mm256_set1_epi32(hash_val_a);
/* For match mask the first bit of every two bits indicates the match */
switch (sig_cmp_fn) {
-#if defined(RTE_MACHINE_CPUFLAG_SSE2)
+#if defined(__SSE2__)
case RTE_HASH_COMPARE_SSE:
/* Compare all signatures in the bucket */
*prim_hash_matches = _mm_movemask_epi8(_mm_cmpeq_epi16(
(__m128i const *)sec_bkt->sig_current),
_mm_set1_epi16(sig)));
break;
-#elif defined(RTE_MACHINE_CPUFLAG_NEON)
+#elif defined(__ARM_NEON)
case RTE_HASH_COMPARE_NEON: {
uint16x8_t vmat, vsig, x;
int16x8_t shift = {-15, -13, -11, -9, -7, -5, -3, -1};
static uint8_t crc32_alg = CRC32_SW;
-#if defined(RTE_ARCH_ARM64) && defined(RTE_MACHINE_CPUFLAG_CRC32)
+#if defined(RTE_ARCH_ARM64) && defined(__ARM_FEATURE_CRC32)
#include "rte_crc_arm64.h"
#else
#include <rte_ip.h>
#include <rte_common.h>
-#if defined(RTE_ARCH_X86) || defined(RTE_MACHINE_CPUFLAG_NEON)
+#if defined(RTE_ARCH_X86) || defined(__ARM_NEON)
#include <rte_vect.h>
#endif
ipv6 = _mm_loadu_si128((const __m128i *)orig->dst_addr);
*(__m128i *)targ->v6.dst_addr =
_mm_shuffle_epi8(ipv6, rte_thash_ipv6_bswap_mask);
-#elif defined(RTE_MACHINE_CPUFLAG_NEON)
+#elif defined(__ARM_NEON)
uint8x16_t ipv6 = vld1q_u8((uint8_t const *)orig->src_addr);
vst1q_u8((uint8_t *)targ->v6.src_addr, vrev32q_u8(ipv6));
ipv6 = vld1q_u8((uint8_t const *)orig->dst_addr);
#define RTE_MEMBER_NAMESIZE 32
/** @internal Hash function used by membership library. */
-#if defined(RTE_ARCH_X86) || defined(RTE_MACHINE_CPUFLAG_CRC32)
+#if defined(RTE_ARCH_X86) || defined(__ARM_FEATURE_CRC32)
#include <rte_hash_crc.h>
#define MEMBER_HASH_FUNC rte_hash_crc
#else
get_buckets_index(ss, key, &prim_bucket, &sec_bucket, &tmp_sig);
switch (ss->sig_cmp_fn) {
-#if defined(RTE_ARCH_X86) && defined(RTE_MACHINE_CPUFLAG_AVX2)
+#if defined(RTE_ARCH_X86) && defined(__AVX2__)
case RTE_MEMBER_COMPARE_AVX2:
if (search_bucket_single_avx(prim_bucket, tmp_sig, buckets,
set_id) ||
for (i = 0; i < num_keys; i++) {
switch (ss->sig_cmp_fn) {
-#if defined(RTE_ARCH_X86) && defined(RTE_MACHINE_CPUFLAG_AVX2)
+#if defined(RTE_ARCH_X86) && defined(__AVX2__)
case RTE_MEMBER_COMPARE_AVX2:
if (search_bucket_single_avx(prim_buckets[i],
tmp_sig[i], buckets, &set_id[i]) ||
get_buckets_index(ss, key, &prim_bucket, &sec_bucket, &tmp_sig);
switch (ss->sig_cmp_fn) {
-#if defined(RTE_ARCH_X86) && defined(RTE_MACHINE_CPUFLAG_AVX2)
+#if defined(RTE_ARCH_X86) && defined(__AVX2__)
case RTE_MEMBER_COMPARE_AVX2:
search_bucket_multi_avx(prim_bucket, tmp_sig, buckets,
&num_matches, match_per_key, set_id);
match_cnt_tmp = 0;
switch (ss->sig_cmp_fn) {
-#if defined(RTE_ARCH_X86) && defined(RTE_MACHINE_CPUFLAG_AVX2)
+#if defined(RTE_ARCH_X86) && defined(__AVX2__)
case RTE_MEMBER_COMPARE_AVX2:
search_bucket_multi_avx(prim_buckets[i], tmp_sig[i],
buckets, &match_cnt_tmp, match_per_key,
enum rte_member_sig_compare_function cmp_fn)
{
switch (cmp_fn) {
-#if defined(RTE_ARCH_X86) && defined(RTE_MACHINE_CPUFLAG_AVX2)
+#if defined(RTE_ARCH_X86) && defined(__AVX2__)
case RTE_MEMBER_COMPARE_AVX2:
if (update_entry_search_avx(prim, sig, buckets, set_id) ||
update_entry_search_avx(sec, sig, buckets,
#include <x86intrin.h>
-#if defined(RTE_MACHINE_CPUFLAG_AVX2)
+#if defined(__AVX2__)
static inline int
update_entry_search_avx(uint32_t bucket_id, member_sig_t tmp_sig,
#include <rte_common.h>
#include <rte_net_crc.h>
-#if defined(RTE_ARCH_X86_64) && defined(RTE_MACHINE_CPUFLAG_PCLMULQDQ)
+#if defined(RTE_ARCH_X86_64) && defined(__PCLMUL__)
#define X86_64_SSE42_PCLMULQDQ 1
-#elif defined(RTE_ARCH_ARM64) && defined(RTE_MACHINE_CPUFLAG_PMULL)
+#elif defined(RTE_ARCH_ARM64) && defined(__ARM_FEATURE_CRYPTO)
#define ARM64_NEON_PMULL 1
#endif
static struct ip4_lookup_node_main ip4_lookup_nm;
-#if defined(RTE_MACHINE_CPUFLAG_NEON)
+#if defined(__ARM_NEON)
#include "ip4_lookup_neon.h"
#elif defined(RTE_ARCH_X86)
#include "ip4_lookup_sse.h"
#ifdef RTE_ARCH_X86
#define SCHED_VECTOR_SSE4
-#elif defined(RTE_MACHINE_CPUFLAG_NEON)
+#elif defined(__ARM_NEON)
#define SCHED_VECTOR_NEON
#endif
#include <rte_vect.h>
#ifndef RTE_TABLE_HASH_LRU_STRATEGY
-#ifdef RTE_MACHINE_CPUFLAG_NEON
+#ifdef __ARM_NEON
#define RTE_TABLE_HASH_LRU_STRATEGY 3
#else /* if no NEON, use simple scalar version */
#define RTE_TABLE_HASH_LRU_STRATEGY 1
return _mm_crc32_u64(crc, v);
}
-#elif defined(RTE_ARCH_ARM64) && defined(RTE_MACHINE_CPUFLAG_CRC32)
+#elif defined(RTE_ARCH_ARM64) && defined(__ARM_FEATURE_CRC32)
#include "rte_table_hash_func_arm64.h"
#else