| 36 | } |
| 37 | |
| 38 | static uint64_t |
| 39 | estimate_tsc_freq(void) |
| 40 | { |
| 41 | #define CYC_PER_10MHZ 1E7 |
| 42 | RTE_LOG(WARNING, EAL, "WARNING: TSC frequency estimated roughly" |
| 43 | " - clock timings may be less accurate.\n"); |
| 44 | /* assume that the rte_delay_us_sleep() will sleep for 1 second */ |
| 45 | uint64_t start = rte_rdtsc(); |
| 46 | rte_delay_us_sleep(US_PER_S); |
| 47 | /* Round up to 10Mhz. 1E7 ~ 10Mhz */ |
| 48 | return RTE_ALIGN_MUL_NEAR(rte_rdtsc() - start, CYC_PER_10MHZ); |
| 49 | } |
| 50 | |
| 51 | void |
| 52 | set_tsc_freq(void) |
no test coverage detected