All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/5] ptp: Support hardware clocks with additional free running cycle counter
@ 2022-04-03 17:55 Gerhard Engleder
  2022-04-03 17:55 ` [PATCH net-next v2 1/5] ptp: Add cycles support for virtual clocks Gerhard Engleder
                   ` (5 more replies)
  0 siblings, 6 replies; 23+ messages in thread
From: Gerhard Engleder @ 2022-04-03 17:55 UTC (permalink / raw)
  To: richardcochran, vinicius.gomes, yangbo.lu, davem, kuba
  Cc: mlichvar, 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.

v2:
- rename ptp_clock cycles to has_cycles (Richard Cochran)
- call it free running cycle counter (Richard Cochran)
- update struct skb_shared_hwtstamps kdoc (Richard Cochran)
- optimize timestamp address/cookie processing path (Richard Cochran,
  Vinicius Costa Gomes)

v1:
- complete rework based on suggestions (Richard Cochran)

Gerhard Engleder (5):
  ptp: Add cycles support for virtual clocks
  ptp: Request cycles for TX timestamp
  ptp: Pass hwtstamp to ptp_convert_timestamp()
  ptp: Support late timestamp determination
  tsnep: Add free running cycle counter support

 drivers/net/ethernet/engleder/tsnep_hw.h   |  9 +++--
 drivers/net/ethernet/engleder/tsnep_main.c | 31 +++++++++++++---
 drivers/net/ethernet/engleder/tsnep_ptp.c  | 28 +++++++++++++++
 drivers/ptp/ptp_clock.c                    | 31 +++++++++++++---
 drivers/ptp/ptp_private.h                  | 10 ++++++
 drivers/ptp/ptp_sysfs.c                    | 10 +++---
 drivers/ptp/ptp_vclock.c                   | 18 ++++------
 include/linux/netdevice.h                  | 21 +++++++++++
 include/linux/ptp_clock_kernel.h           | 38 +++++++++++++++++---
 include/linux/skbuff.h                     | 14 ++++++--
 net/core/skbuff.c                          |  2 ++
 net/socket.c                               | 41 +++++++++++++++-------
 12 files changed, 208 insertions(+), 45 deletions(-)

-- 
2.20.1


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

end of thread, other threads:[~2022-04-16 16:58 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-03 17:55 [PATCH net-next v2 0/5] ptp: Support hardware clocks with additional free running cycle counter Gerhard Engleder
2022-04-03 17:55 ` [PATCH net-next v2 1/5] ptp: Add cycles support for virtual clocks Gerhard Engleder
2022-04-10  6:26   ` Richard Cochran
2022-04-10 12:32     ` Gerhard Engleder
2022-04-03 17:55 ` [PATCH net-next v2 2/5] ptp: Request cycles for TX timestamp Gerhard Engleder
2022-04-10  6:47   ` Richard Cochran
2022-04-10 12:40     ` Gerhard Engleder
2022-04-03 17:55 ` [PATCH net-next v2 3/5] ptp: Pass hwtstamp to ptp_convert_timestamp() Gerhard Engleder
2022-04-03 17:55 ` [PATCH net-next v2 4/5] ptp: Support late timestamp determination Gerhard Engleder
2022-04-10  7:29   ` Richard Cochran
2022-04-10 12:54     ` Gerhard Engleder
2022-04-10 13:42       ` Richard Cochran
2022-04-10 14:42         ` Gerhard Engleder
2022-04-12 19:24           ` Gerhard Engleder
2022-04-12 21:05             ` Vinicius Costa Gomes
2022-04-13 20:28               ` Gerhard Engleder
2022-04-12 21:46             ` Richard Cochran
2022-04-13 20:51               ` Gerhard Engleder
2022-04-14  6:36                 ` Richard Cochran
2022-04-15 22:04                   ` Gerhard Engleder
2022-04-16 16:58                     ` Richard Cochran
2022-04-03 17:55 ` [PATCH net-next v2 5/5] tsnep: Add free running cycle counter support Gerhard Engleder
2022-04-06 23:04 ` [PATCH net-next v2 0/5] ptp: Support hardware clocks with additional free running cycle counter Richard Cochran

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.