DPDK usage discussions
 help / color / mirror / Atom feed
From: Harman Kalra <hkalra@marvell.com>
To: Gokul Bargaje <gokulbargaje.182009@nitk.edu.in>
Cc: Ferruh Yigit <ferruh.yigit@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>, "users@dpdk.org" <users@dpdk.org>
Subject: Re: [dpdk-users] [dpdk-dev] What is the 'unit of timestamp' assigned to mbuf packet in DPDK?
Date: Thu, 28 Nov 2019 08:28:38 +0000	[thread overview]
Message-ID: <20191128082822.GA55554@outlook.office365.com> (raw)
In-Reply-To: <CAH1-=xh_ngR-2r2gt+e_66QRN4Ec7NbXoXqW2tQXf9Vx7tTi=w@mail.gmail.com>

On Fri, Nov 22, 2019 at 10:30:11PM +0530, Gokul Bargaje wrote:
> Thank you for the clarification. But I am still unable to understand how
> exactly timestamp is calculated before assigning to a timestamp field.
> Could you please tell me the steps to calculate the timestamp in DPDK?
> 
> I have to implement the PIE AQM algorithm in DPDK and for that, I need to
> calculate the total time spent by the packet waiting in queue (i.e. the
> difference between enqueue time and dequeue time).
> 
> Thanks,
> Gokul

Hi Gokul

octeontx2 also suports hardware timestamping, as soon as packet enter
the NIC queue, MAC writes the timestamp value to a memory location
(which is later read in mbuf->timestamp). Later using
'rte_eth_read_clock()' one can read the timestamp clock. Hence
"mbuf->timestamp - rte_eth_read_clock()" gives the time spent by packet
when it entered the queue to that point. As everybody suggested you can
refer rxtx_callback for more clarity. 
Octeontx2 driver also has 'rte_eth_read_clock()' eth op implemented

Thanks
Harman

> 
> On Fri, Nov 22, 2019 at 8:18 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
> 
> > On 11/18/2019 2:29 PM, Gokul Bargaje wrote:
> > > Hi,
> > >
> > > The timestamp assigned to packet at the time of enqueue (value of
> > timestamp
> > > field in mbuf), is it in milliseconds or microseconds or in cpu cycles?
> >
> > The unit is not defined [1]. 'rte_eth_read_clock()' was added [2] to help
> > converting it to time when it is clock counter.
> >
> > [1]
> > 918ae9dc775e ("mbuf: add a timestamp field")
> >
> > [2]
> > 5e741377657c ("ethdev: add API to read device clock")
> >
> > >
> > > How this timestamp is calculated? Is it calculated using the
> > *rte_cycles.h*?
> > >
> >
> >
> >
> >
> >
> >

  parent reply	other threads:[~2019-11-28  8:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-18 14:29 [dpdk-users] " Gokul Bargaje
2019-11-22 14:48 ` Ferruh Yigit
2019-11-22 17:00   ` Gokul Bargaje
2019-11-22 17:05     ` Stephen Hemminger
2019-11-27 14:49     ` Tom Barbette
2019-11-28  8:28     ` Harman Kalra [this message]
2019-11-25 10:56 ` Archit Pandey

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=20191128082822.GA55554@outlook.office365.com \
    --to=hkalra@marvell.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=gokulbargaje.182009@nitk.edu.in \
    --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).