From: Tom Barbette <barbette@kth.se>
To: "Wiles, Keith" <keith.wiles@intel.com>
Cc: dpdk-dev <dev@dpdk.org>,
"Richardson, Bruce" <bruce.richardson@intel.com>,
"Mcnamara, John" <john.mcnamara@intel.com>,
Thomas Monjalon <thomas@monjalon.net>,
"Yigit, Ferruh" <ferruh.yigit@intel.com>,
Andrew Rybchenko <arybchenko@solarflare.com>,
Shahaf Shuler <shahafs@mellanox.com>,
Yongseok Koh <yskoh@mellanox.com>,
"olivier.matz@6wind.com" <olivier.matz@6wind.com>
Subject: Re: [dpdk-dev] [PATCH v3 1/3] rte_ethdev: Add API function to read dev clock
Date: Fri, 26 Apr 2019 10:13:25 +0200 [thread overview]
Message-ID: <91e23122-84a2-90dc-e279-175889627228@kth.se> (raw)
Message-ID: <20190426081325.1cHmn35V78vf6COMMgjx4FB5D8osc-wsglEdcwvoun4@z> (raw)
In-Reply-To: <F21E9D23-9769-4AB8-B11E-1B2FF5EEB1CE@intel.com>
@Andrew I applied your comments. Thanks.
On 2019-04-25 20:28, Wiles, Keith wrote:
> What is a raw clock value? It took me a bit to find that it is in nano-seconds need to document that point.
It is not in nanosecond, it has no units. Finding the relation between
the device clock and the real time is the whole point of this API.
> Using timestamp variable is not very descriptive and some other name needs to be used. Also in the driver it is called *clock.
The problem is that the "timestamp offload" feature filling the
timestamp field of the pktmbuf is already badly named as it is given
without time unit. Both of them are not timestamp but raw "clock"
values, a number of ticks at an unknown frequency, with an unknow time
base (ie is it the number of ticks since boot? Device is up? 1/1/1970?).
One solution would be to have an union in the pktmbuf, changing the
timestamp field into a "clock" or "timestamp" field. But it's a bit
overkill.
I propose to change the read_clock API to reference "clock" instead of
timestamp everywhere.
> Another question is why does this routine not perform the looping/delaying and calling read_clock and then return frequency instead. If you want a timestamp reading function then this one is not being described that way and I would think it should be done someplace else or should be.
The frequency is one thing, and would allow to give a relative time in
second between packets. In practice though, we change the frequency (as
Linux does regarding the TSC ticks) to catch up corrections applied by
NTP on the source clock.
The second thing is the time reference, to convert the clock time (of
the packets) to the current wall time. One may want to use the monotonic
clock, the real clock (we do follow both). Or no system clock at all and
directly follow an NTP source. The point is, having a function to give
the frequency is not enough. One can derive the frequency and the time
reference with this API. I could write a helper in a second step to get
the frequency out of read_clock. But the time reference implies timers,
choosing a source, and stuff we don't want here, I think...
>> /** Valid if PKT_RX_TIMESTAMP is set. The unit and time reference
>> * are not normalized but are always the same for a given port.
>> + * Some devices allow to query rte_eth_read_clock that will return the
>> + * current device timestamp.
>
> The message here is not a good place for this detail, I would put it in the function call doc above.
I can remove these lines, but with read_clock referencing only clock I
feel like it's even more needed. Someone reading the doc will see "oh, I
can use timestamp offloading to get precise timing of when my packets
were received, great ! But it has no unit and no reference... What do I
do with that?". It miss the last step "how I see... I can look at
rte_eth_read_clock documentation to read more about conversion."
Thanks !
Tom
next prev parent reply other threads:[~2019-04-26 8:13 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-24 17:34 [dpdk-dev] [PATCH v3 0/3] Add rte_eth_read_clock API Tom Barbette
2019-04-24 17:34 ` Tom Barbette
2019-04-24 17:34 ` [dpdk-dev] [PATCH v3 1/3] rte_ethdev: Add API function to read dev clock Tom Barbette
2019-04-24 17:34 ` Tom Barbette
2019-04-25 17:08 ` Andrew Rybchenko
2019-04-25 17:08 ` Andrew Rybchenko
2019-04-25 18:28 ` Wiles, Keith
2019-04-25 18:28 ` Wiles, Keith
2019-04-26 8:13 ` Tom Barbette [this message]
2019-04-26 8:13 ` Tom Barbette
2019-04-24 17:34 ` [dpdk-dev] [PATCH v3 2/3] mlx5: Implement support for read_clock Tom Barbette
2019-04-24 17:34 ` Tom Barbette
2019-04-24 17:34 ` [dpdk-dev] [PATCH v3 3/3] rxtx_callbacks: Add support for HW timestamp Tom Barbette
2019-04-24 17:34 ` Tom Barbette
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=91e23122-84a2-90dc-e279-175889627228@kth.se \
--to=barbette@kth.se \
--cc=arybchenko@solarflare.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=john.mcnamara@intel.com \
--cc=keith.wiles@intel.com \
--cc=olivier.matz@6wind.com \
--cc=shahafs@mellanox.com \
--cc=thomas@monjalon.net \
--cc=yskoh@mellanox.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).