>From: Intel-wired-lan <[email protected]> On Behalf Of >Andrew Lunn >Sent: Wednesday, November 6, 2024 6:45 PM > >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. >
Sure, I can change it if new version is needed (Kuba's other thread on this) >> >> ** 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 Well, making control knob available to the users. The explanation/rationale/problem statement is available under provided Link, and patch allows part of IEEE 802_3cx standard to be controlled. Thank you! Arkadiusz
