DPDK patches and discussions
 help / color / mirror / Atom feed
* Re: [dpdk-dev] [PATCH 1/3] rte_ethdev: Add API function to read dev clock
@ 2018-12-21  8:25 Tom Barbette
  2018-12-23  6:06 ` Shahaf Shuler
  0 siblings, 1 reply; 15+ messages in thread
From: Tom Barbette @ 2018-12-21  8:25 UTC (permalink / raw)
  To: Ferruh Yigit, dev
  Cc: bruce.richardson, john.mcnamara, Thomas Monjalon,
	Andrew Rybchenko, Shahaf Shuler, Yongseok Koh, Alejandro Lucero

Ferruh Yigit wrote :
> Is this a common enough feature to include into ethdev abstraction layer? Or a
> feature for a single vendor?

I found reference to mbuf’s timestamp field only in MLX5. I think it is the only one to support timestamp offloading. This new API is only useful to make sense out of the timestamp value. And without this patch, timestamp offloading is completely useless…

What would be the other way ? Define something in mlx5 header and ask clients to check for the driver and call the specific API ?

I see reference to timestamp offloading in Netronome Agilio, CC-ing maintainers. Is timestamp offloading a feature you could potentially provide ? Would it be host time reference or a value that need conversion with an API like this?

Tom

^ permalink raw reply	[flat|nested] 15+ messages in thread
* [dpdk-dev] [PATCH 0/3] Add rte_eth_read_clock API
@ 2018-12-19 13:49 Tom Barbette
  2018-12-19 13:49 ` [dpdk-dev] [PATCH 1/3] rte_ethdev: Add API function to read dev clock Tom Barbette
  0 siblings, 1 reply; 15+ messages in thread
From: Tom Barbette @ 2018-12-19 13:49 UTC (permalink / raw)
  To: dev
  Cc: bruce.richardson, john.mcnamara, Thomas Monjalon, Ferruh Yigit,
	Andrew Rybchenko, Shahaf Shuler, Yongseok Koh, Tom Barbette

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

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/Makefile                   |  2 +-
 drivers/net/mlx5/meson.build                |  2 +-
 drivers/net/mlx5/mlx5.c                     |  1 +
 drivers/net/mlx5/mlx5.h                     |  1 +
 drivers/net/mlx5/mlx5_ethdev.c              | 30 +++++++
 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 +
 17 files changed, 204 insertions(+), 7 deletions(-)

-- 
2.17.1

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2019-03-21 19:37 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-21  8:25 [dpdk-dev] [PATCH 1/3] rte_ethdev: Add API function to read dev clock Tom Barbette
2018-12-23  6:06 ` Shahaf Shuler
2019-01-02 17:44   ` Ferruh Yigit
2019-01-08 11:30     ` Tom Barbette
2019-03-19 13:32       ` Yigit, Ferruh
2019-03-19 13:32         ` Yigit, Ferruh
2019-03-20 14:48         ` Thomas Monjalon
2019-03-20 14:48           ` Thomas Monjalon
2019-03-20 15:57           ` Andrew Rybchenko
2019-03-20 15:57             ` Andrew Rybchenko
2019-03-21 19:37             ` Ferruh Yigit
2019-03-21 19:37               ` Ferruh Yigit
  -- strict thread matches above, loose matches on Subject: below --
2018-12-19 13:49 [dpdk-dev] [PATCH 0/3] Add rte_eth_read_clock API Tom Barbette
2018-12-19 13:49 ` [dpdk-dev] [PATCH 1/3] rte_ethdev: Add API function to read dev clock Tom Barbette
2018-12-20  6:42   ` Shahaf Shuler
2018-12-20 19:55   ` Ferruh Yigit

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