DPDK patches and discussions
 help / color / mirror / Atom feed
From: Archit Pandey <architpandeynitk@gmail.com>
To: Gokul Bargaje <gokulbargaje.182009@nitk.edu.in>,
	dev@dpdk.org, users@dpdk.org
Subject: Re: [dpdk-dev] [dpdk-users] What is the 'unit of timestamp' assigned to mbuf packet in DPDK?
Date: Mon, 25 Nov 2019 16:26:05 +0530	[thread overview]
Message-ID: <5a2c9787-c9e1-f295-3d25-89a42a5390ca@gmail.com> (raw)
In-Reply-To: <CAH1-=xgrUZkQoq05Dw+=CQ7wH7NZB5QkSjneXgB_9fAJRcFMhQ@mail.gmail.com>

 From lib/librte_mbuf/rte_mbuf_core.h:

|605 /** Valid if PKT_RX_TIMESTAMP is set. The unit and time reference 
606 * are not normalized but are always the same for a given port. 607 * 
Some devices allow to query rte_eth_read_clock that will return the 608 
* current device timestamp. 609 */ 610 uint64_t timestamp;|

|I believe the timestamp in mbuf is set by the NIC. If it isn't, 
librte_eventdev sets it using rte_get_tsc_cycle(). From 
/lib/librte_eventdev/rte_event_eth_rx_adapter.h |

22 * The adapter uses a EAL service core function for SW based packet transfer
23 * and uses the eventdev PMD functions to configure HW based packet transfer
24 * between the ethernet device and the event device. For SW based packet
25 * transfer, if the mbuf does not have a timestamp set, the adapter adds a
26 * timestamp to the mbuf using rte_get_tsc_cycles(), this provides a more
27 * accurate timestamp as compared to if the application were to set the time
28 * stamp since it avoids event device schedule latency.

Hope that helps!

On 11/18/2019 7:59 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?
>
> How this timestamp is calculated? Is it calculated using the *rte_cycles.h*?
>
> Thanks in advance!
> --Gokul

-- 
Archit Pandey
Senior Year Undergraduate Student
Department of Computer Science and Engineering
National Institute of Technology Karnataka
Surathkal, India


      parent reply	other threads:[~2019-11-25 10:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-18 14:29 [dpdk-dev] " Gokul Bargaje
2019-11-22 14:48 ` [dpdk-dev] [dpdk-users] " 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
2019-11-25 10:56 ` Archit Pandey [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=5a2c9787-c9e1-f295-3d25-89a42a5390ca@gmail.com \
    --to=architpandeynitk@gmail.com \
    --cc=dev@dpdk.org \
    --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).