mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCHv2 next 0/3] add ptp_gettimex64any() API
@ 2023-10-03  4:16 Mahesh Bandewar
  0 siblings, 0 replies; only message in thread
From: Mahesh Bandewar @ 2023-10-03  4:16 UTC (permalink / raw)
  To: Netdev, Linux, David Miller, Jakub Kicinski, Eric Dumazet, Paolo Abeni
  Cc: Jonathan Corbet, John Stultz, Don Hatchett, Yuliang Li,
	Mahesh Bandewar, Mahesh Bandewar

The current API to get the sandwich TS for the master-PTP clock read
supports only the sys-time sandwich. This is not really suitable for
all the use cases of sandwich TS needs. Ideally it should
allow a choice of a timebase to use for ts-sandwich need. Updating
the existing API [gettimex64()] is not an option since it would
break compatibility.

About the name - This is a superset of current gettimex64. Since 
the timebase for gettimex64 is fixed and is only 'sys-time / real-time'. 
I'm appending "any" to add the choice factor. so gettimex64any() would
give you eXtended time with sandwitch TS of a timebase of your choice.
If there is a better name, I won't mind changing.

The timebase options are -
   CLOCK_REALTIME, CLOCK_MONOTONIC, & CLOCK_MONOTONIC_RAW

The CLOCK_REALTIME option is equivalent of using current gettimex64()
method.

The first patch adds this new PTP method while the second patch
adds the ioctl support for this method.

The last patch in the series updates the selftest to exercise this
new method.

Mahesh Bandewar (3):
  ptp: add ptp_gettimex64any() support
  ptp: add ioctl interface for ptp_gettimex64any()
  selftes/ptp: extend test to include ptp_gettimex64any()

 drivers/ptp/ptp_chardev.c             | 34 ++++++++++++
 include/linux/ptp_clock_kernel.h      | 51 ++++++++++++++++++
 include/uapi/linux/ptp_clock.h        | 21 ++++++++
 tools/testing/selftests/Makefile      |  1 +
 tools/testing/selftests/ptp/testptp.c | 76 ++++++++++++++++++++++++++-
 5 files changed, 181 insertions(+), 2 deletions(-)

v1 -> v2
  * Removed ktime_get_cycles64() implementation
  * Removed CYCLES as an option
-- 
2.42.0.582.g8ccd20d70d-goog


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-10-03  4:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-03  4:16 [PATCHv2 next 0/3] add ptp_gettimex64any() API Mahesh Bandewar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®