Measuring core frequency with dpdk

Stephen Hemminger stephen at networkplumber.org
Mon Apr 10 18:12:20 CEST 2023


On Mon, 10 Apr 2023 16:48:14 +0200
Antonio Di Bacco <a.dibacco.ks at gmail.com> wrote:

> Is it possible to measure the core frequency using a DPDK api? Not the
> maximum or nominal frequency but the actual number of instruction
> cycles per second.
> 
> Best regards,
> Anna

The Time Stamp Counter https://en.wikipedia.org/wiki/Time_Stamp_Counter
gets incremented at the CPU clock rate. DPDK API to read the TSC
clock rate is rte_get_tsc_hz().

Internally, the DPDK determines the clock rate either by using
architecture specific information if available or simple heuristic
of number of ticks by doing a sleep().  See lib/eal/common/eal_common_timer.c
for the details.


More information about the users mailing list