DPDK usage discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Antonio Di Bacco <a.dibacco.ks@gmail.com>
Cc: users@dpdk.org
Subject: Re: Measuring core frequency with dpdk
Date: Mon, 10 Apr 2023 09:12:20 -0700	[thread overview]
Message-ID: <20230410091220.1444042f@hermes.local> (raw)
In-Reply-To: <CAO8pfFkKe+g9XupGEJK+Fck3xtG3QPAOaWGVAOU9SLkUDB5PVg@mail.gmail.com>

On Mon, 10 Apr 2023 16:48:14 +0200
Antonio Di Bacco <a.dibacco.ks@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.

      reply	other threads:[~2023-04-10 16:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-10 14:48 Antonio Di Bacco
2023-04-10 16:12 ` Stephen Hemminger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230410091220.1444042f@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=a.dibacco.ks@gmail.com \
    --cc=users@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).