[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d20d8265-4263-4408-8448-4338a268d537@lunn.ch>
Date: Wed, 6 Nov 2024 18:45:18 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Arkadiusz Kubalewski <arkadiusz.kubalewski@...el.com>
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
intel-wired-lan@...ts.osuosl.org, anthony.l.nguyen@...el.com,
przemyslaw.kitszel@...el.com, davem@...emloft.net,
edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
richardcochran@...il.com,
Aleksandr Loktionov <aleksandr.loktionov@...el.com>
Subject: Re: [PATCH net-next v3 1/2] ptp: add control over HW timestamp latch
point
On Wed, Nov 06, 2024 at 02:07:55AM +0100, Arkadiusz Kubalewski wrote:
> Currently HW support of ptp/timesync solutions in network PHY chips can be
> implemented with two different approaches, the timestamp maybe latched
> either at the beginning or after the Start of Frame Delimiter (SFD) [1].
>
> Allow ptp device drivers to provide user with control over the HW
> timestamp latch point with ptp sysfs ABI. Provide a new file under sysfs
> ptp device (/sys/class/ptp/ptp<N>/ts_point). The file is available for the
> user, if the device driver implements at least one of newly provided
> callbacks. If the file is not provided the user shall find a PHY timestamp
> latch point within the HW vendor specification.
>
> The file is designed for root user/group access only, as the read for
> regular user could impact performance of the ptp device.
>
> Usage, examples:
>
> ** Obtain current state:
> $ cat /sys/class/ptp/ptp<N>/ts_point
> Command returns enum/integer:
> * 1 - timestamp latched by PHY at the beginning of SFD,
> * 2 - timestamp latched by PHY after the SFD,
> * None - callback returns error to the user.
-EOPNOTSUPP would be more conventional, not None.
>
> ** Configure timestamp latch point at the beginning of SFD:
> $ echo 1 > /sys/class/ptp/ptp<N>/ts_point
>
> ** Configure timestamp latch point after the SFD:
> $ echo 2 > /sys/class/ptp/ptp<N>/ts_point
and i assume these also return -EOPNOTSUPP if it is not supported.
And a dumb question, why should i care where the latch point is? Why
would i want to change it? Richard always says that you cannot trust
the kernel to have the same latency from kernel to kernel version
because driver developers like to tweak the latency, invalidating all
measurements the user has done when setting up their ptp4l
daemon. This just seems like yet another way to break my ptp4l
configuration.
Andrew
Powered by blists - more mailing lists