DPDK patches and discussions
 help / color / 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
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 index

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 publically 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

DPDK patches and discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ http://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox