DPDK patches and discussions
 help / color / mirror / Atom feed
From: PATRICK KEROULAS <patrick.keroulas@radio-canada.ca>
To: Thomas Monjalon <thomas@monjalon.net>
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: Fri, 22 May 2020 14:43:02 -0400
Message-ID: <CALEF-=AGL=rCSYhZyWYcD8G7Z1d5r+fUX_NZWpp9FzH6UDuwiw@mail.gmail.com> (raw)
In-Reply-To: <2766519.SlWGiteSXv@thomas>

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

Thanks Thomas.
Not sure this is a synchronization issue. We have dedicated processes
(linuxptp) to keep both NIC and sys clocks in sync with an external clock.
It is "just" a matter of unit conversion.

If it has to be performed in dpdk-pdump, I would need some help to
retrieve mlx5_clock_info from inside a secondary process. Looking at
mlx5_read_clock(), this info is extracted from ibv_context which looks
reachable in a primary process only (segfault, if I try in pdump).

  reply	other threads:[~2020-05-22 18:43 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 [this message]
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='CALEF-=AGL=rCSYhZyWYcD8G7Z1d5r+fUX_NZWpp9FzH6UDuwiw@mail.gmail.com' \
    --to=patrick.keroulas@radio-canada.ca \
    --cc=dev@dpdk.org \
    --cc=matan@mellanox.com \
    --cc=rasland@mellanox.com \
    --cc=shahafs@mellanox.com \
    --cc=thomas@monjalon.net \
    --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

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 \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


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