netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v5 0/6] ptp: Support for multiple filtered timestamp event queue readers
@ 2023-10-08 22:49 Xabier Marquiegui
  2023-10-08 22:49 ` [PATCH net-next v5 1/6] posix-clock: introduce posix_clock_context concept Xabier Marquiegui
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Xabier Marquiegui @ 2023-10-08 22:49 UTC (permalink / raw)
  To: netdev
  Cc: richardcochran, tglx, jstultz, horms, chrony-dev, mlichvar,
	reibax, ntp-lists, vinicius.gomes, davem, rrameshbabu, shuah

On systems with multiple timestamp event channels, there can be scenarios
where multiple userspace readers want to access the timestamping data for
various purposes.

One such example is wanting to use a pps out for time synchronization, and
wanting to timestamp external events with the synchronized time base 
simultaneously.

Timestmp event consumers on the other hand, are often interested in a
subset of the available timestamp channels. linuxptp ts2phc, for example,
is not happy if more than one timestamping channel is active on the device
it is reading from.

This patch-set introduces linked lists to support multiple timestamp event
queue consumers, and timestamp event channel filters through IOCTLs, as
well as a debugfs interface to do some simple verifications.

Xabier Marquiegui (6):
  posix-clock: introduce posix_clock_context concept
  ptp: Replace timestamp event queue with linked list
  ptp: support multiple timestamp event readers
  ptp: support event queue reader channel masks
  ptp: add debugfs interface to see applied channel masks
  ptp: add testptp mask test

 drivers/ptp/ptp_chardev.c                   | 129 ++++++++++++++++----
 drivers/ptp/ptp_clock.c                     |  45 ++++++-
 drivers/ptp/ptp_private.h                   |  28 +++--
 drivers/ptp/ptp_sysfs.c                     |  13 +-
 include/linux/posix-clock.h                 |  22 ++--
 include/uapi/linux/ptp_clock.h              |   2 +
 kernel/time/posix-clock.c                   |  36 ++++--
 tools/testing/selftests/ptp/ptpchmaskfmt.sh |  14 +++
 tools/testing/selftests/ptp/testptp.c       |  19 ++-
 9 files changed, 248 insertions(+), 60 deletions(-)
 create mode 100644 tools/testing/selftests/ptp/ptpchmaskfmt.sh

Signed-off-by: Xabier Marquiegui <reibax@gmail.com>
Suggested-by: Richard Cochran <richardcochran@gmail.com>
Suggested-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
---
v5:
  - fix spelling on commit message
  - fix memory leak on ptp_open
v4: https://lore.kernel.org/netdev/cover.1696511486.git.reibax@gmail.com/
  - split modifications in different patches for improved organization
  - rename posix_clock_user to posix_clock_context
  - remove unnecessary flush_users clock operation
  - remove unnecessary tests
  - simpler queue clean procedure
  - fix/clean comment lines
  - simplified release procedures
  - filter modifications exclusive to currently open instance for
    simplicity and security
  - expand mask to 2048 channels
  - make more secure and simple: mask is only applied to the testptp
    instance. Use debugfs to verify effects.
v3: https://lore.kernel.org/netdev/20230928133544.3642650-1-reibax@gmail.com/
  - add this patchset overview file
  - fix use of safe and non safe linked lists for loops
  - introduce new posix_clock private_data and ida object ids for better
    dicrimination of timestamp consumers
  - safer resource release procedures
  - filter application by object id, aided by process id
  - friendlier testptp implementation of event queue channel filters
v2: https://lore.kernel.org/netdev/20230912220217.2008895-1-reibax@gmail.com/
  - fix ptp_poll() return value
  - Style changes to comform to checkpatch strict suggestions
  - more coherent ptp_read error exit routines
  - fix testptp compilation error: unknown type name 'pid_t'
  - rename mask variable for easier code traceability
  - more detailed commit message with two examples
v1: https://lore.kernel.org/netdev/20230906104754.1324412-2-reibax@gmail.com/
---

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

end of thread, other threads:[~2023-10-16  8:14 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-08 22:49 [PATCH net-next v5 0/6] ptp: Support for multiple filtered timestamp event queue readers Xabier Marquiegui
2023-10-08 22:49 ` [PATCH net-next v5 1/6] posix-clock: introduce posix_clock_context concept Xabier Marquiegui
2023-10-09  2:04   ` Richard Cochran
2023-10-11 22:30     ` Xabier Marquiegui
2023-10-09 14:52   ` Thomas Gleixner
2023-10-08 22:49 ` [PATCH net-next v5 2/6] ptp: Replace timestamp event queue with linked list Xabier Marquiegui
2023-10-08 22:49 ` [PATCH net-next v5 3/6] ptp: support multiple timestamp event readers Xabier Marquiegui
2023-10-08 22:49 ` [PATCH net-next v5 4/6] ptp: support event queue reader channel masks Xabier Marquiegui
2023-10-08 22:49 ` [PATCH net-next v5 5/6] ptp: add debugfs interface to see applied " Xabier Marquiegui
2023-10-10  0:54   ` Jakub Kicinski
2023-10-11 22:36     ` Xabier Marquiegui
2023-10-12 23:37       ` Jakub Kicinski
2023-10-16  8:14         ` Xabier Marquiegui
2023-10-08 22:49 ` [PATCH net-next v5 6/6] ptp: add testptp mask test Xabier Marquiegui

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