netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v1 0/6] ptp: Support hardware clocks with additional free running time
@ 2022-03-22 21:07 Gerhard Engleder
  2022-03-22 21:07 ` [PATCH net-next v1 1/6] ptp: Add cycles support for virtual clocks Gerhard Engleder
                   ` (6 more replies)
  0 siblings, 7 replies; 25+ messages in thread
From: Gerhard Engleder @ 2022-03-22 21:07 UTC (permalink / raw)
  To: richardcochran, yangbo.lu, davem, kuba
  Cc: mlichvar, vinicius.gomes, netdev, Gerhard Engleder

ptp vclocks require a clock with free running time for the timecounter.
Currently only a physical clock forced to free running is supported.
If vclocks are used, then the physical clock cannot be synchronized
anymore. The synchronized time is not available in hardware in this
case. As a result, timed transmission with TAPRIO hardware support
is not possible anymore.

If hardware would support a free running time additionally to the
physical clock, then the physical clock does not need to be forced to
free running. Thus, the physical clocks can still be synchronized while
vclocks are in use.

The physical clock could be used to synchronize the time domain of the
TSN network and trigger TAPRIO. In parallel vclocks can be used to
synchronize other time domains.

One year ago I thought for two time domains within a TSN network also
two physical clocks are required. This would lead to new kernel
interfaces for asking for the second clock, ... . But actually for a
time triggered system like TSN there can be only one time domain that
controls the system itself. All other time domains belong to other
layers, but not to the time triggered system itself. So other time
domains can be based on a free running counter if similar mechanisms
like 2 step synchroisation are used.

Synchronisation was tested with two time domains between two directly
connected hosts. Each host run two ptp4l instances, the first used the
physical clock and the second used the virtual clock. I used my FPGA
based network controller as network device. ptp4l was used in
combination with the virtual clock support patches from Miroslav
Lichvar.

v1:
- comlete rework based on feedback to RFC (Richard Cochran)

Gerhard Engleder (6):
  ptp: Add cycles support for virtual clocks
  ptp: Request cycles for TX timestamp
  ptp: Pass hwtstamp to ptp_convert_timestamp()
  ethtool: Add kernel API for PHC index
  ptp: Support late timestamp determination
  tsnep: Add physical clock cycles support

 drivers/net/ethernet/engleder/tsnep_hw.h   |  9 ++-
 drivers/net/ethernet/engleder/tsnep_main.c | 27 ++++++---
 drivers/net/ethernet/engleder/tsnep_ptp.c  | 44 ++++++++++++++
 drivers/ptp/ptp_clock.c                    | 58 +++++++++++++++++--
 drivers/ptp/ptp_private.h                  | 10 ++++
 drivers/ptp/ptp_sysfs.c                    | 10 ++--
 drivers/ptp/ptp_vclock.c                   | 18 +++---
 include/linux/ethtool.h                    |  8 +++
 include/linux/ptp_clock_kernel.h           | 67 ++++++++++++++++++++--
 include/linux/skbuff.h                     | 11 +++-
 net/core/skbuff.c                          |  2 +
 net/ethtool/common.c                       | 13 +++++
 net/socket.c                               | 45 +++++++++++----
 13 files changed, 275 insertions(+), 47 deletions(-)

-- 
2.20.1


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

end of thread, other threads:[~2022-03-26  0:27 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-22 21:07 [PATCH net-next v1 0/6] ptp: Support hardware clocks with additional free running time Gerhard Engleder
2022-03-22 21:07 ` [PATCH net-next v1 1/6] ptp: Add cycles support for virtual clocks Gerhard Engleder
2022-03-24 13:43   ` Richard Cochran
2022-03-24 19:39     ` Gerhard Engleder
2022-03-22 21:07 ` [PATCH net-next v1 2/6] ptp: Request cycles for TX timestamp Gerhard Engleder
2022-03-24 13:49   ` Richard Cochran
2022-03-24 13:55     ` Miroslav Lichvar
2022-03-24 19:43     ` Gerhard Engleder
2022-03-22 21:07 ` [PATCH net-next v1 3/6] ptp: Pass hwtstamp to ptp_convert_timestamp() Gerhard Engleder
2022-03-24 13:50   ` Richard Cochran
2022-03-22 21:07 ` [PATCH net-next v1 4/6] ethtool: Add kernel API for PHC index Gerhard Engleder
2022-03-24 13:51   ` Richard Cochran
2022-03-22 21:07 ` [PATCH net-next v1 5/6] ptp: Support late timestamp determination Gerhard Engleder
2022-03-23  0:54   ` kernel test robot
2022-03-23  1:05   ` kernel test robot
2022-03-23  2:06   ` kernel test robot
2022-03-24 14:01   ` Richard Cochran
2022-03-24 19:52     ` Gerhard Engleder
2022-03-25  0:04       ` Richard Cochran
2022-03-25  0:08         ` Richard Cochran
2022-03-25 20:51           ` Gerhard Engleder
2022-03-26  0:27   ` Vinicius Costa Gomes
2022-03-22 21:07 ` [PATCH net-next v1 6/6] tsnep: Add physical clock cycles support Gerhard Engleder
2022-03-25  0:01 ` [PATCH net-next v1 0/6] ptp: Support hardware clocks with additional free running time Vinicius Costa Gomes
2022-03-25 22:01   ` Gerhard Engleder

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