net: Add support for providing the PTP hardware source in tsinfo

Multi-PTP source support within a network topology has been merged,
but the hardware timestamp source is not yet exposed to users.
Currently, users only see the PTP index, which does not indicate
whether the timestamp comes from a PHY or a MAC.

Add support for reporting the hwtstamp source using a
hwtstamp-source field, alongside hwtstamp-phyindex, to describe
the origin of the hardware timestamp.

Remove HWTSTAMP_SOURCE_UNSPEC enum value as it is not used at all.

Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
Link: https://patch.msgid.link/20250519-feature_ptp_source-v4-1-5d10e19a0265@bootlin.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
Kory Maincent
2025-05-19 10:45:05 +02:00
committed by Paolo Abeni
parent 3da895b239
commit 4ff4d86f6c
6 changed files with 94 additions and 11 deletions

View File

@@ -98,6 +98,24 @@ definitions:
name: tcp-data-split
type: enum
entries: [ unknown, disabled, enabled ]
-
name: hwtstamp-source
doc: Source of the hardware timestamp
enum-name: hwtstamp-source
name-prefix: hwtstamp-source-
type: enum
entries:
-
name: netdev
doc: |
Hardware timestamp comes from a MAC or a device
which has MAC and PHY integrated
value: 1
-
name: phylib
doc: |
Hardware timestamp comes from one PHY device
of the network topology
attribute-sets:
-
@@ -896,6 +914,13 @@ attribute-sets:
name: hwtstamp-provider
type: nest
nested-attributes: ts-hwtstamp-provider
-
name: hwtstamp-source
type: u32
enum: hwtstamp-source
-
name: hwtstamp-phyindex
type: u32
-
name: cable-result
attr-cnt-name: __ethtool-a-cable-result-cnt
@@ -1981,6 +2006,8 @@ operations:
- phc-index
- stats
- hwtstamp-provider
- hwtstamp-source
- hwtstamp-phyindex
dump: *tsinfo-get-op
-
name: cable-test-act