From 577329e66b9f1e1c227c0f6cb76fe47bb8f8c38c Mon Sep 17 00:00:00 2001 From: Jerin Jacob Date: Mon, 5 Jun 2017 14:28:43 +0530 Subject: [PATCH] eal: switch to architecture specific pause function Remove rte_pause() definition from rte_common.h and switchover to architecture specific rte_pause.h Signed-off-by: Jerin Jacob --- examples/distributor/main.c | 1 + examples/l2fwd-jobstats/main.c | 1 + examples/performance-thread/l3fwd-thread/main.c | 1 + examples/tep_termination/main.c | 1 + examples/vhost/main.c | 1 + examples/vhost_xen/main.c | 1 + lib/librte_distributor/rte_distributor.c | 2 ++ lib/librte_distributor/rte_distributor_v20.c | 2 ++ lib/librte_eal/common/eal_common_launch.c | 1 + lib/librte_eal/common/eal_common_timer.c | 1 + .../common/include/arch/ppc_64/rte_spinlock.h | 1 + .../common/include/arch/x86/rte_spinlock.h | 1 + .../common/include/generic/rte_rwlock.h | 1 + .../common/include/generic/rte_spinlock.h | 1 + lib/librte_eal/common/include/rte_common.h | 15 --------------- lib/librte_eal/common/include/rte_eal_memconfig.h | 1 + lib/librte_eal/linuxapp/eal/eal_interrupts.c | 1 + lib/librte_hash/rte_cuckoo_hash.c | 1 + lib/librte_ring/rte_ring.h | 1 + lib/librte_timer/rte_timer.c | 1 + test/test/test_common.c | 1 + test/test/test_cryptodev.c | 1 + test/test/test_cryptodev_blockcipher.c | 1 + test/test/test_distributor_perf.c | 1 + test/test/test_eventdev_sw.c | 3 ++- test/test/test_ring_perf.c | 1 + test/test/test_timer.c | 1 + test/test/test_timer_perf.c | 1 + test/test/test_timer_racecond.c | 1 + 29 files changed, 31 insertions(+), 16 deletions(-) diff --git a/examples/distributor/main.c b/examples/distributor/main.c index 8071f91955..cf8982a711 100644 --- a/examples/distributor/main.c +++ b/examples/distributor/main.c @@ -43,6 +43,7 @@ #include #include #include +#include #define RX_RING_SIZE 512 #define TX_RING_SIZE 512 diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c index e6e6c22865..d21e8338ea 100644 --- a/examples/l2fwd-jobstats/main.c +++ b/examples/l2fwd-jobstats/main.c @@ -67,6 +67,7 @@ #include #include #include +#include #define RTE_LOGTYPE_L2FWD RTE_LOGTYPE_USER1 diff --git a/examples/performance-thread/l3fwd-thread/main.c b/examples/performance-thread/l3fwd-thread/main.c index 8237ac65e6..fb847d13ea 100644 --- a/examples/performance-thread/l3fwd-thread/main.c +++ b/examples/performance-thread/l3fwd-thread/main.c @@ -73,6 +73,7 @@ #include #include #include +#include #include #include diff --git a/examples/tep_termination/main.c b/examples/tep_termination/main.c index 83c2189fff..aee36c6e48 100644 --- a/examples/tep_termination/main.c +++ b/examples/tep_termination/main.c @@ -50,6 +50,7 @@ #include #include #include +#include #include "main.h" #include "vxlan.h" diff --git a/examples/vhost/main.c b/examples/vhost/main.c index b625c52a0c..30abaecfa9 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c @@ -52,6 +52,7 @@ #include #include #include +#include #include "main.h" diff --git a/examples/vhost_xen/main.c b/examples/vhost_xen/main.c index ed26e28ade..69213a4b9c 100644 --- a/examples/vhost_xen/main.c +++ b/examples/vhost_xen/main.c @@ -48,6 +48,7 @@ #include #include #include +#include #include "main.h" #include "virtio-net.h" diff --git a/lib/librte_distributor/rte_distributor.c b/lib/librte_distributor/rte_distributor.c index e4dfa7f0e3..32dd18edca 100644 --- a/lib/librte_distributor/rte_distributor.c +++ b/lib/librte_distributor/rte_distributor.c @@ -42,6 +42,8 @@ #include #include #include +#include + #include "rte_distributor_private.h" #include "rte_distributor.h" #include "rte_distributor_v20.h" diff --git a/lib/librte_distributor/rte_distributor_v20.c b/lib/librte_distributor/rte_distributor_v20.c index bb6c5d709f..b09abecd52 100644 --- a/lib/librte_distributor/rte_distributor_v20.c +++ b/lib/librte_distributor/rte_distributor_v20.c @@ -41,6 +41,8 @@ #include #include #include +#include + #include "rte_distributor_v20.h" #include "rte_distributor_private.h" diff --git a/lib/librte_eal/common/eal_common_launch.c b/lib/librte_eal/common/eal_common_launch.c index 1848466062..137c191dd1 100644 --- a/lib/librte_eal/common/eal_common_launch.c +++ b/lib/librte_eal/common/eal_common_launch.c @@ -41,6 +41,7 @@ #include #include #include +#include #include #include diff --git a/lib/librte_eal/common/eal_common_timer.c b/lib/librte_eal/common/eal_common_timer.c index 72656176e6..ed0b16d05e 100644 --- a/lib/librte_eal/common/eal_common_timer.c +++ b/lib/librte_eal/common/eal_common_timer.c @@ -41,6 +41,7 @@ #include #include #include +#include #include "eal_private.h" diff --git a/lib/librte_eal/common/include/arch/ppc_64/rte_spinlock.h b/lib/librte_eal/common/include/arch/ppc_64/rte_spinlock.h index af139c9d35..39815d9ee4 100644 --- a/lib/librte_eal/common/include/arch/ppc_64/rte_spinlock.h +++ b/lib/librte_eal/common/include/arch/ppc_64/rte_spinlock.h @@ -38,6 +38,7 @@ extern "C" { #endif #include +#include #include "generic/rte_spinlock.h" /* Fixme: Use intrinsics to implement the spinlock on Power architecture */ diff --git a/lib/librte_eal/common/include/arch/x86/rte_spinlock.h b/lib/librte_eal/common/include/arch/x86/rte_spinlock.h index 8e630c219e..5675c2b45c 100644 --- a/lib/librte_eal/common/include/arch/x86/rte_spinlock.h +++ b/lib/librte_eal/common/include/arch/x86/rte_spinlock.h @@ -43,6 +43,7 @@ extern "C" { #include "rte_cpuflags.h" #include "rte_branch_prediction.h" #include "rte_common.h" +#include "rte_pause.h" #define RTE_RTM_MAX_RETRIES (10) #define RTE_XABORT_LOCK_BUSY (0xff) diff --git a/lib/librte_eal/common/include/generic/rte_rwlock.h b/lib/librte_eal/common/include/generic/rte_rwlock.h index 7a0fdc55c8..fdb3113d36 100644 --- a/lib/librte_eal/common/include/generic/rte_rwlock.h +++ b/lib/librte_eal/common/include/generic/rte_rwlock.h @@ -52,6 +52,7 @@ extern "C" { #include #include +#include /** * The rte_rwlock_t type. diff --git a/lib/librte_eal/common/include/generic/rte_spinlock.h b/lib/librte_eal/common/include/generic/rte_spinlock.h index e51fc56bad..54f83a4c56 100644 --- a/lib/librte_eal/common/include/generic/rte_spinlock.h +++ b/lib/librte_eal/common/include/generic/rte_spinlock.h @@ -51,6 +51,7 @@ #ifdef RTE_FORCE_INTRINSICS #include #endif +#include /** * The rte_spinlock_t type. diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h index 2251bfaec3..99596de0a2 100644 --- a/lib/librte_eal/common/include/rte_common.h +++ b/lib/librte_eal/common/include/rte_common.h @@ -304,21 +304,6 @@ rte_align64pow2(uint64_t v) /*********** Other general functions / macros ********/ -#ifdef __SSE2__ -#include -/** - * PAUSE instruction for tight loops (avoid busy waiting) - */ -static inline void -rte_pause (void) -{ - _mm_pause(); -} -#else -static inline void -rte_pause(void) {} -#endif - /** * Searches the input parameter for the least significant set bit * (starting from zero). diff --git a/lib/librte_eal/common/include/rte_eal_memconfig.h b/lib/librte_eal/common/include/rte_eal_memconfig.h index 2b5e0b1706..b9eee702ef 100644 --- a/lib/librte_eal/common/include/rte_eal_memconfig.h +++ b/lib/librte_eal/common/include/rte_eal_memconfig.h @@ -39,6 +39,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { diff --git a/lib/librte_eal/linuxapp/eal/eal_interrupts.c b/lib/librte_eal/linuxapp/eal/eal_interrupts.c index 2e3bd12a43..3e9ac41ee5 100644 --- a/lib/librte_eal/linuxapp/eal/eal_interrupts.c +++ b/lib/librte_eal/linuxapp/eal/eal_interrupts.c @@ -64,6 +64,7 @@ #include #include #include +#include #include "eal_private.h" #include "eal_vfio.h" diff --git a/lib/librte_hash/rte_cuckoo_hash.c b/lib/librte_hash/rte_cuckoo_hash.c index 1b7a0da9f0..80391cfac9 100644 --- a/lib/librte_hash/rte_cuckoo_hash.c +++ b/lib/librte_hash/rte_cuckoo_hash.c @@ -57,6 +57,7 @@ #include #include #include +#include #include "rte_hash.h" #include "rte_cuckoo_hash.h" diff --git a/lib/librte_ring/rte_ring.h b/lib/librte_ring/rte_ring.h index 18684a53d1..f5880dfca8 100644 --- a/lib/librte_ring/rte_ring.h +++ b/lib/librte_ring/rte_ring.h @@ -101,6 +101,7 @@ extern "C" { #include #include #include +#include #define RTE_TAILQ_RING_NAME "RTE_RING" diff --git a/lib/librte_timer/rte_timer.c b/lib/librte_timer/rte_timer.c index 43e61782dd..dda9baf550 100644 --- a/lib/librte_timer/rte_timer.c +++ b/lib/librte_timer/rte_timer.c @@ -51,6 +51,7 @@ #include #include #include +#include #include "rte_timer.h" diff --git a/test/test/test_common.c b/test/test/test_common.c index 8effa2f9ed..6e803f5d35 100644 --- a/test/test/test_common.c +++ b/test/test/test_common.c @@ -35,6 +35,7 @@ #include #include #include +#include #include "test.h" diff --git a/test/test/test_cryptodev.c b/test/test/test_cryptodev.c index f8f15c0631..8766cad020 100644 --- a/test/test/test_cryptodev.c +++ b/test/test/test_cryptodev.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include diff --git a/test/test/test_cryptodev_blockcipher.c b/test/test/test_cryptodev_blockcipher.c index 603c77652c..ce350e39fb 100644 --- a/test/test/test_cryptodev_blockcipher.c +++ b/test/test/test_cryptodev_blockcipher.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include diff --git a/test/test/test_distributor_perf.c b/test/test/test_distributor_perf.c index 732d86d0ed..7d69887b97 100644 --- a/test/test/test_distributor_perf.c +++ b/test/test/test_distributor_perf.c @@ -40,6 +40,7 @@ #include #include #include +#include #define ITER_POWER_CL 25 /* log 2 of how many iterations for Cache Line test */ #define ITER_POWER 21 /* log 2 of how many iterations we do when timing. */ diff --git a/test/test/test_eventdev_sw.c b/test/test/test_eventdev_sw.c index 7da6c256e8..ba8c053e5a 100644 --- a/test/test/test_eventdev_sw.c +++ b/test/test/test_eventdev_sw.c @@ -47,8 +47,9 @@ #include #include #include - #include +#include + #include "test.h" #define MAX_PORTS 16 diff --git a/test/test/test_ring_perf.c b/test/test/test_ring_perf.c index ed89896b36..84d2003325 100644 --- a/test/test/test_ring_perf.c +++ b/test/test/test_ring_perf.c @@ -37,6 +37,7 @@ #include #include #include +#include #include "test.h" diff --git a/test/test/test_timer.c b/test/test/test_timer.c index 2f6525a506..de0c312fa6 100644 --- a/test/test/test_timer.c +++ b/test/test/test_timer.c @@ -136,6 +136,7 @@ #include #include #include +#include #define TEST_DURATION_S 1 /* in seconds */ #define NB_TIMER 4 diff --git a/test/test/test_timer_perf.c b/test/test/test_timer_perf.c index fa77efbd25..467ae13daa 100644 --- a/test/test/test_timer_perf.c +++ b/test/test/test_timer_perf.c @@ -42,6 +42,7 @@ #include #include #include +#include #define MAX_ITERATIONS 1000000 diff --git a/test/test/test_timer_racecond.c b/test/test/test_timer_racecond.c index 7824ec4bf6..5e08f06bed 100644 --- a/test/test/test_timer_racecond.c +++ b/test/test/test_timer_racecond.c @@ -42,6 +42,7 @@ #include #include #include +#include #undef TEST_TIMER_RACECOND_VERBOSE -- 2.20.1