DPDK patches and discussions
 help / color / mirror / Atom feed
From: Slava Ovsiienko <viacheslavo@mellanox.com>
To: PATRICK KEROULAS <patrick.keroulas@radio-canada.ca>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	Vivien Didelot <vivien.didelot@gmail.com>,
	 Shahaf Shuler <shahafs@mellanox.com>,
	Raslan Darawsheh <rasland@mellanox.com>,
	Matan Azrad <matan@mellanox.com>
Subject: Re: [dpdk-dev] mlx5 & pdump: convert HW timestamps to nanoseconds
Date: Sun, 31 May 2020 19:47:20 +0000
Message-ID: <AM4PR05MB326542FB8D5B49EEB7F23AA8D28D0@AM4PR05MB3265.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <CALEF-=D-qtmO-urE4WB3xJCPO1d086a4T=0isk3xhd=90RpJcQ@mail.gmail.com>

Hi, Patrick

Please, see below.

>From: PATRICK KEROULAS <patrick.keroulas@radio-canada.ca> 
>Sent: Friday, May 29, 2020 23:56
>To: Slava Ovsiienko <viacheslavo@mellanox.com>
>Cc: dev@dpdk.org; Vivien Didelot <vivien.didelot@gmail.com>; Shahaf Shuler <shahafs@mellanox.com>; Raslan Darawsheh <rasland@mellanox.com>; Matan Azrad ><matan@mellanox.com>
>Subject: Re: [dpdk-dev] mlx5 & pdump: convert HW timestamps to nanoseconds
>On Tue, May 26, 2020 at 12:00 PM Slava Ovsiienko <mailto:viacheslavo@mellanox.com> wrote:
>>> Hi, Patrick
>> ConnectX HW timestamp is the captured value of internal 64-bit counter running at the frequency,
>> reported in the device_frequency_khz field of struct mlx5_ifc_cmd_hca_cap_bits{}.
>> This structure is queried in mlx5_devx_cmd_query_hca_attr() routine.
>> So, with known frequency it is possible to recalculate timestamp ticks to desired units.
>Hello Slava,
>Assuming that the NIC clock is already synced thanks to a PTP client,
>does the bit counter give an absolute time value (0 => 1 January 1970
>00:00:00)? Or do I need to calculate a time duration from the process
>start time?
I would not make any assumption about internal clock phase and its relation to time (UTC?).
I suppose the getting the initial value of clock counter and calculating the actual time at the app start is valid approach.

>I just want to validate the path from mlx5 eth dev(Rx) to eth pcap (Tx) :
>- query the oscillator frequency at the mlx5_eth_dev init step
>  (mlx5_devx_cmd_query_hca_attr())
>- store the freq with other hca_attr, carried by dev config which should
>  be shared with the secondary process
>- in eth_pcap_tx_dumper(), retrieve the freq from the dev given by
>  mbuf->port
>- convert all the incoming mbuf->timestamp using this freq whose
>  variation should be negligible over the capture duration
Should work OK, as for me.

>Last question: what is your opinion about this other method?
>Thanks a lot!
This code checks the counter periodically to track the counter wraparound and provides the older timestamp conversion (got before clock base update).
 If your have the stream of pkts with monotonically increasing timestamp you could track this counter wrap in your code (save the last ts conversion result and counter value).

With best regards, Slava

  reply	other threads:[~2020-05-31 19:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-19 18:20 PATRICK KEROULAS
2020-05-21 15:33 ` Thomas Monjalon
2020-05-21 19:57   ` PATRICK KEROULAS
2020-05-21 20:09     ` Thomas Monjalon
2020-05-22 18:43       ` PATRICK KEROULAS
2020-05-26  7:44         ` Tom Barbette
2020-05-29 20:46           ` N. Benes
2020-05-26 16:00         ` Slava Ovsiienko
2020-05-29 20:56           ` PATRICK KEROULAS
2020-05-31 19:47             ` Slava Ovsiienko [this message]
2020-06-02 19:18           ` PATRICK KEROULAS
2020-06-03  7:48             ` Slava Ovsiienko
2020-06-05  0:09               ` PATRICK KEROULAS
2020-06-05 16:30                 ` Slava Ovsiienko

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:

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

  git send-email \
    --in-reply-to=AM4PR05MB326542FB8D5B49EEB7F23AA8D28D0@AM4PR05MB3265.eurprd05.prod.outlook.com \
    --to=viacheslavo@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=matan@mellanox.com \
    --cc=patrick.keroulas@radio-canada.ca \
    --cc=rasland@mellanox.com \
    --cc=shahafs@mellanox.com \
    --cc=vivien.didelot@gmail.com \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://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/ https://inbox.dpdk.org/dev \
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:

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