timer: honor arch-specific TSC frequency query
When calibrating the TSC frequency, first, probe the architecture specific function. If not available, use the existing calibrate scheme. Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com> Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Tested-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
This commit is contained in:
parent
3486534628
commit
3dbc565e81
@ -92,6 +92,7 @@ SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += rte_service.c
|
||||
# from arch dir
|
||||
SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += rte_cpuflags.c
|
||||
SRCS-$(CONFIG_RTE_ARCH_X86) += rte_spinlock.c
|
||||
SRCS-y += rte_cycles.c
|
||||
|
||||
CFLAGS_eal_common_cpuflags.o := $(CPUFLAGS_LIST)
|
||||
|
||||
|
7
lib/librte_eal/common/arch/arm/rte_cycles.c
Normal file
7
lib/librte_eal/common/arch/arm/rte_cycles.c
Normal file
@ -0,0 +1,7 @@
|
||||
#include "eal_private.h"
|
||||
|
||||
uint64_t
|
||||
get_tsc_freq_arch(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
7
lib/librte_eal/common/arch/ppc_64/rte_cycles.c
Normal file
7
lib/librte_eal/common/arch/ppc_64/rte_cycles.c
Normal file
@ -0,0 +1,7 @@
|
||||
#include "eal_private.h"
|
||||
|
||||
uint64_t
|
||||
get_tsc_freq_arch(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
7
lib/librte_eal/common/arch/x86/rte_cycles.c
Normal file
7
lib/librte_eal/common/arch/x86/rte_cycles.c
Normal file
@ -0,0 +1,7 @@
|
||||
#include "eal_private.h"
|
||||
|
||||
uint64_t
|
||||
get_tsc_freq_arch(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
@ -80,8 +80,11 @@ estimate_tsc_freq(void)
|
||||
void
|
||||
set_tsc_freq(void)
|
||||
{
|
||||
uint64_t freq = get_tsc_freq();
|
||||
uint64_t freq;
|
||||
|
||||
freq = get_tsc_freq_arch();
|
||||
if (!freq)
|
||||
freq = get_tsc_freq();
|
||||
if (!freq)
|
||||
freq = estimate_tsc_freq();
|
||||
|
||||
|
@ -314,6 +314,17 @@ void set_tsc_freq(void);
|
||||
*/
|
||||
uint64_t get_tsc_freq(void);
|
||||
|
||||
/**
|
||||
* Get TSC frequency if the architecture supports.
|
||||
*
|
||||
* This function is private to the EAL.
|
||||
*
|
||||
* @return
|
||||
* The number of TSC cycles in one second.
|
||||
* Returns zero if the architecture support is not available.
|
||||
*/
|
||||
uint64_t get_tsc_freq_arch(void);
|
||||
|
||||
/**
|
||||
* Prepare physical memory mapping
|
||||
* i.e. hugepages on Linux and
|
||||
|
@ -101,6 +101,7 @@ SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += rte_service.c
|
||||
# from arch dir
|
||||
SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += rte_cpuflags.c
|
||||
SRCS-$(CONFIG_RTE_ARCH_X86) += rte_spinlock.c
|
||||
SRCS-y += rte_cycles.c
|
||||
|
||||
CFLAGS_eal_common_cpuflags.o := $(CPUFLAGS_LIST)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user