/**
* Get the number of cycles since boot from the default timer.
*
* @return
* The number of cycles
*/
static inline uint64_t
rte_get_timer_cycles(void)
{
#ifdef RTE_LIBEAL_USE_HPET
switch(eal_timer_source) {
case EAL_TIMER_TSC:
#endif
return rte_get_tsc_cycles();
#ifdef RTE_LIBEAL_USE_HPET
case EAL_TIMER_HPET:
return rte_get_hpet_cycles();
default: rte_panic("Invalid timer source specified\n");
}
#endif
}
rte_get_timer_cycles()
rte_get_hpet_cycles()
dpdk推荐使用rte_get_timer_cycles()
和rte_get_timer_hz()
API来替代HPET的特有API;如果一个应用使用了rte_get_hpet_cycles()
和rte_get_hpet_hz()
的API接口……