Discussion:
[Linuxptp-devel] [PATCH] tsproc: Fix time stamp handling with P2P one shot mode.
Richard Cochran
2016-03-31 14:52:53 UTC
Permalink
When the P2P link partner is using one shot mode, the residence time
in the peer (t3 - t2) is reflected in the correction field of the
peer delay response message, and t2 and t3 are both zero.

The function port_peer_delay() calls clock_peer_delay(), passing in
the zero valued 't2' to the 'rx' argument. The latter function then
stores the zero value in the 't4' field of the clock's tsproc
instance.

As a result, tsproc_update_delay() returns an error to
clock_synchronize(), and so a slave clock will never leave the
"uncalibrated" state.

This patch fixes the issue by removing the test for a non-zero 't4'
field within the tsproc.

Signed-off-by: Richard Cochran <***@gmail.com>
---
tsproc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tsproc.c b/tsproc.c
index 7e14b24..cf5f0dc 100644
--- a/tsproc.c
+++ b/tsproc.c
@@ -164,7 +164,7 @@ int tsproc_update_offset(struct tsproc *tsp, tmv_t *offset, double *weight)
tmv_t delay, raw_delay = 0;

if (tmv_is_zero(tsp->t1) || tmv_is_zero(tsp->t2) ||
- tmv_is_zero(tsp->t3) || tmv_is_zero(tsp->t4))
+ tmv_is_zero(tsp->t3))
return -1;

if (tsp->raw_mode || tsp->weighting)
--
2.1.4
Miroslav Lichvar
2016-04-01 07:18:27 UTC
Permalink
Post by Richard Cochran
When the P2P link partner is using one shot mode, the residence time
in the peer (t3 - t2) is reflected in the correction field of the
peer delay response message, and t2 and t3 are both zero.
The function port_peer_delay() calls clock_peer_delay(), passing in
the zero valued 't2' to the 'rx' argument. The latter function then
stores the zero value in the 't4' field of the clock's tsproc
instance.
As a result, tsproc_update_delay() returns an error to
This should say tsproc_update_offset() ?
Post by Richard Cochran
clock_synchronize(), and so a slave clock will never leave the
"uncalibrated" state.
This patch fixes the issue by removing the test for a non-zero 't4'
field within the tsproc.
Acked-by: Miroslav Lichvar <***@redhat.com>

Thanks,
--
Miroslav Lichvar
Richard Cochran
2016-04-01 09:07:06 UTC
Permalink
Post by Miroslav Lichvar
Post by Richard Cochran
As a result, tsproc_update_delay() returns an error to
This should say tsproc_update_offset() ?
Jup, that is what I meant.

Thanks,
Richard

Loading...