[chrony-dev] Support for Multiple PPS Inputs on single PHC

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-dev Archives ]


While some devices, eg an intel i210, support timestamping different inputs on multiple channels, chrony currently does not. Somewhat surprisingly, if you pass a PTP_EXTTS_REQUEST this does not, in fact, result in future reads on the socket being filtered to the given `index` passed in the ioctl. As far as I can tell, from the kernel `ptp_read` there's no way to filter reads by channel at all.

Thus, if we have a chrony config with multiple PHC refclocks on the same device but different pin/channels, we throw away samples somewhat at random due to the channel check at [1].

I'd love to see support for handling multiple inputs from one device, and am happy to hack up a patch, but I have never touched or read chrony code for more than a few minutes.

My naive solution from skimming the code would be to shove formerly-discarded samples into a global limited queue and check for available timestamps in `phc_poll`. However, I have no idea if the time difference between when the sample was taken by the hardware and when the `HCL_CookTime` call is done would impact accuracy (or maybe the opposite, since we'd then be cooking time with the hardware clock right after taking the HCL sample rather than when the PHC timestamp happens), or if such a patch would simply be rejected as a dirty, dirty hack rather than unifying the PHC read sockets across the devices into one socket (via some global tracking the device -> socket mapping?) and passing the samples out appropriately. Let me know what makes the most sense here.

[1] https://git.tuxfamily.org/chrony/chrony.git/tree/refclock_phc.c#n131

--
To unsubscribe email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject.
For help email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/