DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Wiles, Keith" <keith.wiles@intel.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: Tom Barbette <barbette@kth.se>, 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>
Subject: Re: [dpdk-dev] [PATCH v2 0/3] Add rte_eth_read_clock API
Date: Wed, 27 Mar 2019 14:54:32 +0000	[thread overview]
Message-ID: <3652C395-2CA3-4F74-BD45-0F06386633FB@intel.com> (raw)
Message-ID: <20190327145432.p-wvASusTvCpse9K8EZsZ1ZhO7seffbNVzOXmbjfbjE@z> (raw)
In-Reply-To: <20190327074112.427c4758@shemminger-XPS-13-9360>



> On Mar 27, 2019, at 9:41 AM, Stephen Hemminger <stephen@networkplumber.org> wrote:
> 
> On Wed, 27 Mar 2019 07:19:32 +0100
> Tom Barbette <barbette@kth.se> wrote:
> 
>> Some NICs allow to timestamp packets, but do not support the full
>> PTP synchronization process. Hence, the value set in the mbuf
>> timestamp field is only the raw value of an internal clock.
>> 
>> To make sense of this value, one at least needs to be able to query
>> the current hardware clock value. As with the TSC, from there
>> a frequency can be derieved by querying multiple time the current value of the
>> internal clock with some known delay between the queries (example
>> provided in the API doc).
>> 
>> This patch series adds support for MLX5.
>> 
>> An example app is provided in the rxtx_callback application.
>> It has been updated to display, on top of the software latency
>> in cycles, the total latency since the packet was received in hardware.
>> The API is used to compute a delta in the TX callback. The raw amount of
>> ticks is converted to cycles using a variation of the technique describe above.
>> 
>> Aside from offloading timestamping, which relieve the
>> software from a few operations, this allows to get much more precision
>> when studying the source of the latency in a system.
>> Eg. in our 100G, CX5 setup the rxtx callback application shows
>> SW latency is around 74 cycles (TSC is 3.2Ghz), but the latency
>> including NIC processing, PCIe, and queuing is around 196 cycles.
>> 
>> One may think at first this API is overlapping with te_eth_timesync_read_time.
>> rte_eth_timesync_read_time is clearly identified as part of a set of functions
>> to use PTP synchronization.
>> The device raw clock is not "sync" in any way. More importantly, the returned
>> value is not a timeval, but an amount of ticks. We could have a cast-based
>> solution, but on top of being an ugly solution, some people seeing the timeval
>> type of rte_eth_timesync_read_time could use it blindly.
>> 
>> Change in v2:
>>  - Rebase on current master
>> 
>> Tom Barbette (3):
>>  rte_ethdev: Add API function to read dev clock
>>  mlx5: Implement support for read_clock
>>  rxtx_callbacks: Add support for HW timestamp
>> 
>> doc/guides/nics/features.rst                |  1 +
>> doc/guides/sample_app_ug/rxtx_callbacks.rst |  9 ++-
>> drivers/net/mlx5/mlx5.c                     |  1 +
>> drivers/net/mlx5/mlx5.h                     |  1 +
>> drivers/net/mlx5/mlx5_ethdev.c              | 29 +++++++
>> drivers/net/mlx5/mlx5_glue.c                |  8 ++
>> drivers/net/mlx5/mlx5_glue.h                |  2 +
>> examples/rxtx_callbacks/Makefile            |  2 +
>> examples/rxtx_callbacks/main.c              | 86 ++++++++++++++++++++-
>> examples/rxtx_callbacks/meson.build         |  1 +
>> lib/librte_ethdev/rte_ethdev.c              | 13 ++++
>> lib/librte_ethdev/rte_ethdev.h              | 44 +++++++++++
>> lib/librte_ethdev/rte_ethdev_core.h         |  6 ++
>> lib/librte_ethdev/rte_ethdev_version.map    |  1 +
>> lib/librte_mbuf/rte_mbuf.h                  |  2 +
>> 15 files changed, 201 insertions(+), 5 deletions(-)
> 
> 
> I like this approach but would like to see the same API supported
> on multiple devices.
> 
> The current timestamp API is a mess because not all devices behave the
> same way. Trying to write an application that uses timestamping is therefore
> very difficult.

Another question is this an optional API for a PMD? I assume it is.

I know the API rte_eht_read_clock() is attempting to read the NIC for this timestamp, but if the PMD does not support this request can we just default to the rte_rdtsc() as a return value?

Regards,
Keith


  parent reply	other threads:[~2019-03-27 14:54 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-27  6:19 Tom Barbette
2019-03-27  6:19 ` Tom Barbette
2019-03-27  6:19 ` [dpdk-dev] [PATCH v2 1/3] rte_ethdev: Add API function to read dev clock Tom Barbette
2019-03-27  6:19   ` Tom Barbette
2019-04-02 17:46   ` Ferruh Yigit
2019-04-02 17:46     ` Ferruh Yigit
2019-04-02 19:24     ` Tom Barbette
2019-04-02 19:24       ` Tom Barbette
2019-03-27  6:19 ` [dpdk-dev] [PATCH v2 2/3] mlx5: Implement support for read_clock Tom Barbette
2019-03-27  6:19   ` Tom Barbette
2019-04-02 17:47   ` Ferruh Yigit
2019-04-02 17:47     ` Ferruh Yigit
2019-04-02 18:26   ` Ferruh Yigit
2019-04-02 18:26     ` Ferruh Yigit
2019-04-02 19:05     ` Tom Barbette
2019-04-02 19:05       ` Tom Barbette
2019-04-03  5:28   ` Shahaf Shuler
2019-04-03  5:28     ` Shahaf Shuler
2019-03-27  6:19 ` [dpdk-dev] [PATCH v2 3/3] rxtx_callbacks: Add support for HW timestamp Tom Barbette
2019-03-27  6:19   ` Tom Barbette
2019-04-02 18:22   ` Ferruh Yigit
2019-04-02 18:22     ` Ferruh Yigit
2019-04-02 19:39     ` Tom Barbette
2019-04-02 19:39       ` Tom Barbette
2019-03-27 14:41 ` [dpdk-dev] [PATCH v2 0/3] Add rte_eth_read_clock API Stephen Hemminger
2019-03-27 14:41   ` Stephen Hemminger
2019-03-27 14:48   ` Thomas Monjalon
2019-03-27 14:48     ` Thomas Monjalon
2019-03-27 14:54   ` Wiles, Keith [this message]
2019-03-27 14:54     ` Wiles, Keith
2019-03-27 16:08     ` Tom Barbette
2019-03-27 16:08       ` 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=3652C395-2CA3-4F74-BD45-0F06386633FB@intel.com \
    --to=keith.wiles@intel.com \
    --cc=arybchenko@solarflare.com \
    --cc=barbette@kth.se \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=john.mcnamara@intel.com \
    --cc=shahafs@mellanox.com \
    --cc=stephen@networkplumber.org \
    --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).