Skip to content

ptp: Support for multiple filtered timestamp event queue readers

Xabier Marquiegui netdev 6 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest6 patches 0 repliesApplied 6/6
  2. v56 patches 7 repliesSuperseded
  3. v46 patches 6 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v33 patches14 repliesSuperseded
v23 patches4 repliesSuperseded
v13 patches1 replySuperseded

Changes in v6 from the cover letter · 32 lines

- correct commit message
- correct coding style
v5: https://lore.kernel.org/netdev/[email protected]/
- fix spelling on commit message
- fix memory leak on ptp_open
v4: https://lore.kernel.org/netdev/[email protected]/
- 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/[email protected]/
- 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/[email protected]/
- 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/[email protected]/
---

Patches in v6 All 6 applied

#Subject and filesSizeRepliesApplied
1/6posix-clock: introduce posix_clock_context conceptdrivers/ptp/ptp_chardev.c drivers/ptp/ptp_private.h include/linux/posix-clock.h +1 more+76 -320 repliesApplied
2/6ptp: Replace timestamp event queue with linked listdrivers/ptp/ptp_chardev.c drivers/ptp/ptp_clock.c drivers/ptp/ptp_private.h +1 more+42 -60 repliesApplied
3/6ptp: support multiple timestamp event readersdrivers/ptp/ptp_chardev.c drivers/ptp/ptp_clock.c drivers/ptp/ptp_private.h +1 more+55 -290 repliesApplied
4/6ptp: support event queue reader channel masksdrivers/ptp/ptp_chardev.c drivers/ptp/ptp_clock.c drivers/ptp/ptp_private.h +1 more+41 -20 repliesApplied
5/6ptp: add debugfs interface to see applied channel masksdrivers/ptp/ptp_chardev.c drivers/ptp/ptp_clock.c drivers/ptp/ptp_private.h +1 more+39 -00 repliesApplied
6/6ptp: add testptp mask testtools/testing/selftests/ptp/testptp.c+18 -10 repliesApplied

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v6 yet.

Read the v6 thread

Cover letter [PATCH net-next v6 0/6] ptp: Support for multiple filtered timestamp event queue readers

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.

Linked lists are introduced 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                 |  35 ++++--
 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, 261 insertions(+), 60 deletions(-)
 create mode 100644 tools/testing/selftests/ptp/ptpchmaskfmt.sh

---
v6:
- correct commit message
- correct coding style
v5: https://lore.kernel.org/netdev/[email protected]/
- fix spelling on commit message
- fix memory leak on ptp_open
v4: https://lore.kernel.org/netdev/[email protected]/
- 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/[email protected]/
- 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/[email protected]/
- 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/[email protected]/
---