[chrony-dev] Support for Multiple PPS Inputs on single PHC |
[ Thread Index |
Date Index
| More chrony.tuxfamily.org/chrony-dev Archives
]
- To: chrony-dev@xxxxxxxxxxxxxxxxxxxx
- Subject: [chrony-dev] Support for Multiple PPS Inputs on single PHC
- From: Matt Corallo <ntp-lists@xxxxxxxxxxxxxxx>
- Date: Wed, 15 Feb 2023 22:27:15 -0800
- Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mattcorallo.com; s=1676527262; h=Subject:From:To:From:Subject:To:Cc:Cc: Reply-To:In-Reply-To:References; bh=VcTYHBFjjSFTvF6YewBUbhI/iLdfm/FZaE0sSBkCKTk=; b=JJt5DrA+kT8PwY/cg3g8nkzS51 VONDfofGBdxQvfmEIxdZAf3p704byJnKYVDqTqfYRLMVix8QnjjUot1C7WH9OzfBjrxxhXq39AhlP a2hBWru2729JgCzEDUBu7b/wE5c8ziQ1imO4yhOXFuL0D3kR2P7Sb7jcvIiauQpNsPwssRyGQ57ig t7ftxvstgy2Egu3SGyL/PXMPD0Rsb7fkv3PLNHyeV7wKg0ZfMoVwy3QAlxBfIcxJadt2XzqEULytC bvzi8oM0EPjPcS6OJtRgCkT3unvUnjpTkUultSNbi5yzdo5BMYLiCMyjcF9kYbzRioXwl/tNGKgIp 2AIdvn2w==;
- Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=clients.mail.as397444.net; s=1676527263; h=Subject:From:To:From:Subject:To: Cc:Cc:Reply-To:In-Reply-To:References; bh=VcTYHBFjjSFTvF6YewBUbhI/iLdfm/FZaE0sSBkCKTk=; b=A+1rPI+fG55d16Gk9iAddt0Pr2 6Ol8fb8DYjbxjXz4gWUcq6/tq8Kd4C3DBmxKScNDI9Rc3TbGPehaHO9AI0WkdGWiQjSJ2cD8hjA3z Y7j9tT3F2wZ2QFWdzbyh07ds/4ufS1liYGgBktbkQA6rdMuRGs1J6mroxFfYsz2SzepRIgCxJhcVq ApdKq6w1+n4DWlbwsr6fWhh6ymJRWyC8sapbba+FgMWjilzgw+oAoGCVN4qci0B0Arv83yVlA5FBX fQH237HMDMPnQt+YQSCGWSJd3EzW+HRdCG/L30XvbC5pEYK0L422ldcqAkkVVOOe7uPvwrmXgVZOm p8/hQbkg==;
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.