-----Original Message-----
From: achaiken@aurora.tech <redacted>
Sent: Monday, August 01, 2022 6:38 AM
To: Brandeburg, Jesse <redacted>;
richardcochran@gmail.com
Cc: spayne@aurora.tech; achaiken@aurora.tech; alison@she-devel.com;
netdev@vger.kernel.org; intel-wired-lan@lists.osuosl.org
Subject: [PATCH] Use ixgbe_ptp_reset on linkup/linkdown for X550
From: Steve Payne <redacted>
For an unknown reason, when `ixgbe_ptp_start_cyclecounter` is called
from `ixgbe_watchdog_link_is_down` the PHC on the NIC jumps backward
by a seemingly inconsistent amount, which causes discontinuities in
time synchronization. Explicitly reset the NIC's PHC to
`CLOCK_REALTIME` whenever the NIC goes up or down by calling
`ixgbe_ptp_reset` instead of the bare `ixgbe_ptp_start_cyclecounter`.
Signed-off-by: Steve Payne <redacted>
Signed-off-by: Alison Chaiken <redacted>
Resetting PTP could be a problem if the clock was not being synchronized with the kernel CLOCK_REALTIME,
That is true, but most likely not really important, as the unmitigated
problem also introduces significant discontinuities in time.
Basically, this patch does not make things worse.
and does result in some loss of timer precision either way due to the delays involved with setting the time.
That precision loss is negligible compared to jumps resulting from
link down/up, and should be corrected by normal PTP operation very
quickly.
Do you have an example of the clock jump? How much is it?
From: Jacob Keller <jacob.e.keller@intel.com> Date: 2022-08-01 23:29:54
On 8/1/2022 4:00 PM, Ilya Evenbach wrote:
quoted
quoted
-----Original Message-----
From: achaiken@aurora.tech <redacted>
Sent: Monday, August 01, 2022 6:38 AM
To: Brandeburg, Jesse <redacted>;
richardcochran@gmail.com
Cc: spayne@aurora.tech; achaiken@aurora.tech; alison@she-devel.com;
netdev@vger.kernel.org; intel-wired-lan@lists.osuosl.org
Subject: [PATCH] Use ixgbe_ptp_reset on linkup/linkdown for X550
From: Steve Payne <redacted>
For an unknown reason, when `ixgbe_ptp_start_cyclecounter` is called
from `ixgbe_watchdog_link_is_down` the PHC on the NIC jumps backward
by a seemingly inconsistent amount, which causes discontinuities in
time synchronization. Explicitly reset the NIC's PHC to
`CLOCK_REALTIME` whenever the NIC goes up or down by calling
`ixgbe_ptp_reset` instead of the bare `ixgbe_ptp_start_cyclecounter`.
Signed-off-by: Steve Payne <redacted>
Signed-off-by: Alison Chaiken <redacted>
Resetting PTP could be a problem if the clock was not being synchronized with the kernel CLOCK_REALTIME,
That is true, but most likely not really important, as the unmitigated
problem also introduces significant discontinuities in time.
Basically, this patch does not make things worse.
Sure, but I am trying to see if I can understand *why* things get wonky.
I suspect the issue is caused because of how we're resetting the
cyclecounter.
quoted
and does result in some loss of timer precision either way due to the delays involved with setting the time.
That precision loss is negligible compared to jumps resulting from
link down/up, and should be corrected by normal PTP operation very
quickly.
Only if CLOCK_REALTIME is actually being synchronized. Yes, that is
generally true, but its not necessarily guaranteed.
quoted
Do you have an example of the clock jump? How much is it?
Thanks.
I think what's actually going on is a bug in the
ixgbe_ptp_start_cyclecounter function where the system time registers
are being reset.
What hardware are you operating on? Do you know if its an X550 board? It
looks like this has been the case since a9763f3cb54c ("ixgbe: Update PTP
to support X550EM_x devices").
The start_cyclecounter was never supposed to modify the current time
registers, but resetting it to 0 as it does for X550 devices would give
the exact behavior you're seeing.
On Mon, Aug 1, 2022 at 4:29 PM Jacob Keller [off-list ref] wrote:
On 8/1/2022 4:00 PM, Ilya Evenbach wrote:
quoted
quoted
quoted
-----Original Message-----
From: achaiken@aurora.tech <redacted>
Sent: Monday, August 01, 2022 6:38 AM
To: Brandeburg, Jesse <redacted>;
richardcochran@gmail.com
Cc: spayne@aurora.tech; achaiken@aurora.tech; alison@she-devel.com;
netdev@vger.kernel.org; intel-wired-lan@lists.osuosl.org
Subject: [PATCH] Use ixgbe_ptp_reset on linkup/linkdown for X550
From: Steve Payne <redacted>
For an unknown reason, when `ixgbe_ptp_start_cyclecounter` is called
from `ixgbe_watchdog_link_is_down` the PHC on the NIC jumps backward
by a seemingly inconsistent amount, which causes discontinuities in
time synchronization. Explicitly reset the NIC's PHC to
`CLOCK_REALTIME` whenever the NIC goes up or down by calling
`ixgbe_ptp_reset` instead of the bare `ixgbe_ptp_start_cyclecounter`.
Signed-off-by: Steve Payne <redacted>
Signed-off-by: Alison Chaiken <redacted>
Resetting PTP could be a problem if the clock was not being synchronized with the kernel CLOCK_REALTIME,
That is true, but most likely not really important, as the unmitigated
problem also introduces significant discontinuities in time.
Basically, this patch does not make things worse.
Sure, but I am trying to see if I can understand *why* things get wonky.
I suspect the issue is caused because of how we're resetting the
cyclecounter.
quoted
quoted
and does result in some loss of timer precision either way due to the delays involved with setting the time.
That precision loss is negligible compared to jumps resulting from
link down/up, and should be corrected by normal PTP operation very
quickly.
Only if CLOCK_REALTIME is actually being synchronized. Yes, that is
generally true, but its not necessarily guaranteed.
quoted
quoted
Do you have an example of the clock jump? How much is it?
Thanks.
I think what's actually going on is a bug in the
ixgbe_ptp_start_cyclecounter function where the system time registers
are being reset.
What hardware are you operating on? Do you know if its an X550 board?
Indeed it is.
It
looks like this has been the case since a9763f3cb54c ("ixgbe: Update PTP
to support X550EM_x devices").
The current test results come from v5.15.49-rt47. We observed the same
problem in 5.4.93-rt51, which contains a9763f3cb54c.
The start_cyclecounter was never supposed to modify the current time
registers, but resetting it to 0 as it does for X550 devices would give
the exact behavior you're seeing.
That certainly sounds plausible.
Thanks,
Alison Chaiken
Aurora Innovation
From: Jacob Keller <jacob.e.keller@intel.com> Date: 2022-08-02 00:38:24
On 8/1/2022 5:24 PM, Alison Chaiken wrote:
On Mon, Aug 1, 2022 at 4:29 PM Jacob Keller [off-list ref] wrote:
quoted
On 8/1/2022 4:00 PM, Ilya Evenbach wrote:
quoted
quoted
quoted
-----Original Message-----
From: achaiken@aurora.tech <redacted>
Sent: Monday, August 01, 2022 6:38 AM
To: Brandeburg, Jesse <redacted>;
richardcochran@gmail.com
Cc: spayne@aurora.tech; achaiken@aurora.tech; alison@she-devel.com;
netdev@vger.kernel.org; intel-wired-lan@lists.osuosl.org
Subject: [PATCH] Use ixgbe_ptp_reset on linkup/linkdown for X550
From: Steve Payne <redacted>
For an unknown reason, when `ixgbe_ptp_start_cyclecounter` is called
from `ixgbe_watchdog_link_is_down` the PHC on the NIC jumps backward
by a seemingly inconsistent amount, which causes discontinuities in
time synchronization. Explicitly reset the NIC's PHC to
`CLOCK_REALTIME` whenever the NIC goes up or down by calling
`ixgbe_ptp_reset` instead of the bare `ixgbe_ptp_start_cyclecounter`.
Signed-off-by: Steve Payne <redacted>
Signed-off-by: Alison Chaiken <redacted>
Resetting PTP could be a problem if the clock was not being synchronized with the kernel CLOCK_REALTIME,
That is true, but most likely not really important, as the unmitigated
problem also introduces significant discontinuities in time.
Basically, this patch does not make things worse.
Sure, but I am trying to see if I can understand *why* things get wonky.
I suspect the issue is caused because of how we're resetting the
cyclecounter.
quoted
quoted
and does result in some loss of timer precision either way due to the delays involved with setting the time.
That precision loss is negligible compared to jumps resulting from
link down/up, and should be corrected by normal PTP operation very
quickly.
Only if CLOCK_REALTIME is actually being synchronized. Yes, that is
generally true, but its not necessarily guaranteed.
quoted
quoted
Do you have an example of the clock jump? How much is it?
Thanks.
I think what's actually going on is a bug in the
ixgbe_ptp_start_cyclecounter function where the system time registers
are being reset.
What hardware are you operating on? Do you know if its an X550 board?
Indeed it is.
quoted
It
looks like this has been the case since a9763f3cb54c ("ixgbe: Update PTP
to support X550EM_x devices").
The current test results come from v5.15.49-rt47. We observed the same
problem in 5.4.93-rt51, which contains a9763f3cb54c.
quoted
The start_cyclecounter was never supposed to modify the current time
registers, but resetting it to 0 as it does for X550 devices would give
the exact behavior you're seeing.
That certainly sounds plausible.
Thanks,
Alison Chaiken
Aurora Innovation
I just posted a fix which moves the SYSTIME clearing out of
start_cyclecounter and into ixgbe_ptp_reset. I'm fairly confident that
its the correct fix, based on the function comments. I think the
implementor for the X550 simply didn't understand the separation of
ixgbe_ptp_start_cyclecouter and ixgbe_ptp_reset.
Thanks,
Jake
From: Jacob Keller <jacob.e.keller@intel.com> Date: 2022-08-02 00:26:11
On 8/1/2022 4:29 PM, Jacob Keller wrote:
On 8/1/2022 4:00 PM, Ilya Evenbach wrote:
quoted
quoted
quoted
-----Original Message-----
From: achaiken@aurora.tech <redacted>
Sent: Monday, August 01, 2022 6:38 AM
To: Brandeburg, Jesse <redacted>;
richardcochran@gmail.com
Cc: spayne@aurora.tech; achaiken@aurora.tech; alison@she-devel.com;
netdev@vger.kernel.org; intel-wired-lan@lists.osuosl.org
Subject: [PATCH] Use ixgbe_ptp_reset on linkup/linkdown for X550
From: Steve Payne <redacted>
For an unknown reason, when `ixgbe_ptp_start_cyclecounter` is called
from `ixgbe_watchdog_link_is_down` the PHC on the NIC jumps backward
by a seemingly inconsistent amount, which causes discontinuities in
time synchronization. Explicitly reset the NIC's PHC to
`CLOCK_REALTIME` whenever the NIC goes up or down by calling
`ixgbe_ptp_reset` instead of the bare `ixgbe_ptp_start_cyclecounter`.
Signed-off-by: Steve Payne <redacted>
Signed-off-by: Alison Chaiken <redacted>
Resetting PTP could be a problem if the clock was not being synchronized with the kernel CLOCK_REALTIME,
That is true, but most likely not really important, as the unmitigated
problem also introduces significant discontinuities in time.
Basically, this patch does not make things worse.
Sure, but I am trying to see if I can understand *why* things get wonky.
I suspect the issue is caused because of how we're resetting the
cyclecounter.
quoted
quoted
and does result in some loss of timer precision either way due to the delays involved with setting the time.
That precision loss is negligible compared to jumps resulting from
link down/up, and should be corrected by normal PTP operation very
quickly.
Only if CLOCK_REALTIME is actually being synchronized. Yes, that is
generally true, but its not necessarily guaranteed.
quoted
quoted
Do you have an example of the clock jump? How much is it?
Thanks.
I think what's actually going on is a bug in the
ixgbe_ptp_start_cyclecounter function where the system time registers
are being reset.
What hardware are you operating on? Do you know if its an X550 board? It
looks like this has been the case since a9763f3cb54c ("ixgbe: Update PTP
to support X550EM_x devices").
The start_cyclecounter was never supposed to modify the current time
registers, but resetting it to 0 as it does for X550 devices would give
the exact behavior you're seeing.
I just posted an alternative fix which I believe resolves this issue.
Thanks,
Jake
-----Original Message-----
From: achaiken@aurora.tech <redacted>
Sent: Monday, August 01, 2022 6:38 AM
To: Brandeburg, Jesse <redacted>;
richardcochran@gmail.com
Cc: spayne@aurora.tech; achaiken@aurora.tech; alison@she-devel.com;
netdev@vger.kernel.org; intel-wired-lan@lists.osuosl.org
Subject: [PATCH] Use ixgbe_ptp_reset on linkup/linkdown for X550
From: Steve Payne <redacted>
For an unknown reason, when `ixgbe_ptp_start_cyclecounter` is called
from `ixgbe_watchdog_link_is_down` the PHC on the NIC jumps backward
by a seemingly inconsistent amount, which causes discontinuities in
time synchronization. Explicitly reset the NIC's PHC to
`CLOCK_REALTIME` whenever the NIC goes up or down by calling
`ixgbe_ptp_reset` instead of the bare `ixgbe_ptp_start_cyclecounter`.
Signed-off-by: Steve Payne <redacted>
Signed-off-by: Alison Chaiken <redacted>
Resetting PTP could be a problem if the clock was not being synchronized with the kernel CLOCK_REALTIME,
That is true, but most likely not really important, as the unmitigated
problem also introduces significant discontinuities in time.
Basically, this patch does not make things worse.
Sure, but I am trying to see if I can understand *why* things get wonky.
I suspect the issue is caused because of how we're resetting the
cyclecounter.
quoted
quoted
and does result in some loss of timer precision either way due to the delays involved with setting the time.
That precision loss is negligible compared to jumps resulting from
link down/up, and should be corrected by normal PTP operation very
quickly.
Only if CLOCK_REALTIME is actually being synchronized. Yes, that is
generally true, but its not necessarily guaranteed.
quoted
quoted
Do you have an example of the clock jump? How much is it?
Thanks.
I think what's actually going on is a bug in the
ixgbe_ptp_start_cyclecounter function where the system time registers
are being reset.
What hardware are you operating on? Do you know if its an X550 board? It
looks like this has been the case since a9763f3cb54c ("ixgbe: Update PTP
to support X550EM_x devices").
The start_cyclecounter was never supposed to modify the current time
registers, but resetting it to 0 as it does for X550 devices would give
the exact behavior you're seeing.
I just posted an alternative fix which I believe resolves this issue.
Thanks,
Jake
This was already submitted to net as [1], and it looks like it's already
applied to the stable Linux 5.19, 5.15, and 5.10 stable trees.
I've confirmed that it's in the v6.0 tag as commit 25d7a5f5a6bb ("ixgbe:
stop resetting SYSTIME in ixgbe_ptp_start_cyclecounter")
[1]
https://lore.kernel.org/netdev/20220824193748.874343-2-anthony.l.nguyen@intel.com/
Hope that helps!
Thanks,
Jake