[dpdk-users] What is the 'unit of timestamp' assigned to mbuf packet in DPDK?
Archit Pandey
architpandeynitk at gmail.com
Mon Nov 25 11:56:05 CET 2019
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
More information about the users
mailing list