DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: PATRICK KEROULAS <patrick.keroulas@radio-canada.ca>
Cc: dev@dpdk.org, Vivien Didelot <vivien.didelot@gmail.com>,
	shahafs@mellanox.com, rasland@mellanox.com, matan@mellanox.com
Subject: Re: [dpdk-dev] mlx5 & pdump: convert HW timestamps to nanoseconds
Date: Thu, 21 May 2020 22:09:53 +0200	[thread overview]
Message-ID: <2766519.SlWGiteSXv@thomas> (raw)
In-Reply-To: <CALEF-=Bft3byhx6w7HL-fq_s4Y3VcJ1u6BGN6B5aMCVWam=P8g@mail.gmail.com>

21/05/2020 21:57, PATRICK KEROULAS:
> > > I'm trying to build an accurate capture device based on Mellanox
> > > Connect-X5 with following requirements:
> > > - capture every incoming packets with hardware timestamps
> > > - output: pcap with timestamps in nanoseconds
> > > My problem is that the packets forwarded to `dpdk-pdump` carry raw
> > > timestamps from NIC clock.
> >
> > Please could you describe how you use dpdk-pdump?
> > Is it using the mlx5 PMD or pcap PMD?
> 
> We're actually using both:
> # Rx, receive from NIC
> CONFIG_RTE_LIBRTE_MLX5_PMD=y
> # Tx, output to pcap file
> CONFIG_RTE_LIBRTE_PMD_PCAP=y
> 
> $ sudo ./build/app/testpmd -w 0000:01:00.0 -w 0000:01:00.1 -n4 --
> --enable-rx-timestamp
> $ dpdk-pdump -- --pdump 'port=0,queue=*,rx-dev=capture.pcap'

OK thanks

> We've sent this placeholder with the intention to start the discussion.
> https://github.com/DPDK/dpdk/commit/bd371e1ba5bfc5b7092d712a01bbc28799fd58bc.patch
> https://github.com/DPDK/dpdk/commit/e6f5c731c4ab27ab80b229af98c9b3d257e13843.patch

We don't use GitHub. It is just a mirror.
Thanks for having started the discussion in the mailing list,
it is more efficient :)


> > > mlx5 part of libibverbs includes a ts-to-ns converter which takes the
> > > instantaneous clock info. It's unused in dpdk so far. I've tested it in the
> > > device/port init routine and the result looks reliable. Since this approach
> > > looks very simple, compared to the time sync mechanism, I'm trying to
> > > integrate.
> > >
> > > The conversion should occur in the primary process (testpmd) I suppose.
> > > 1) The needed clock info derives from ethernet device. Is it possible to
> > >    access that struct from a rx callback?
> > > 2) how to attach the nanosecond to mbuf so that `pdump` catches it?
> > >    (workaround: copy `mbuf->udata64` in forwarded packets.)
> > > 3) any other idea?
> >
> > The timestamp is carried in mbuf.
> > Then the conversion must be done by the ethdev caller (application or
> > any other upper layer).
> 
> What if the converter function needs a clock_info?
> https://github.com/linux-rdma/rdma-core/blob/7af01c79e00555207dee6132d72e7bfc1bb5485e/providers/mlx5/mlx5dv.h#L1201
> I'm affraid this info may change by the time the converter is called
> by upper layer.

Indeed, the clock in the device is not an atomic one :)
We need to adjust the time conversion continuously.
I am not an expert of time synchronization, so I add more people Cc
who could help for having a precise timestamp.



  reply	other threads:[~2020-05-21 20:10 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 [this message]
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
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:
  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=2766519.SlWGiteSXv@thomas \
    --to=thomas@monjalon.net \
    --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 \
    /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).