Re: [net-next 03/15] net/mlx5: Add adjphase function to support hardware-only offset control
From: Jakub Kicinski <kuba@kernel.org>
Date: 2023-01-20 05:45:24
From: Jakub Kicinski <kuba@kernel.org>
Date: 2023-01-20 05:45:24
On Thu, 19 Jan 2023 21:22:00 -0800 Rahul Rameshbabu wrote:
quoted
Hm, so are you saying that: adjtime(delta): clock += delta but: adjfreq(delta):Did you mean adjphase here?
Yes, sorry
quoted
on clock tick & while delta > 0: clock += small_value delta -= small_value because from looking at mlx5 driver code its unclear whether the implementation does a precise but one shot adjustment or gradual adjustments.The pseudo code your drafted is accurate otherwise. The lack of clarity in our driver comes from leaving the responsibility of that smooth gradual transition (to keep in sync with the clock frequency while running) up to the device.
Ah, I see. That makes sense. This is how system clocks react too or is it a local PTP invention? I think it may be worth documenting in ptp_clock_kernel.h, most driver authors may not understand the difference between adjtime and adjphase :(