Any comments on this workaround / fix ?. It's working in my test
environment. Since the P2P mode continuously evaluates the link delay
independent of the Sync messages using the last raw delay seems to be
reasonable. We definitely cannot use t2=0 as it's a new origin and the
originTimestamp has a different origin.
Methlal
On 11/19/2021 3:54 AM, Methlal Pallewatta wrote:
Says exactly the same thing in page 59.
Port-2 either:
Conveys the difference between the timestamps t2 and t3 in the
Pdelay_Resp message, or
Conveys the difference between the timestamps t2 and t3 in a
Pdelay_Resp_Follow_Up message, or
Conveys the timestamps t2 and t3 in the Pdelay_Resp and
Pdelay_Resp_Follow_Up messages,
respectively.
On 11/19/2021 3:44 AM, Geva, Erez wrote:
Is the new IEEE Std 1588-2019 have any updates on that?
-----Original Message-----
From: Methlal Pallewatta <mp...@mindspring.com>
Sent: Friday, 19 November 2021 12:17
To: linuxptp-devel@lists.sourceforge.net
Subject: [Linuxptp-devel] Inconsistent remote timestamps in the P2P mode
Hi all,
In the section 6.6.4 (page 35) of the IEEE Std 1588-2008 the
following is stated about the port 2 in the P2P mode.
Port-2 either:
1. returns the difference between the timestamps t2 and t3 in the
Pdelay_Resp message 2. returns the difference between the timestamps
t2 and t3 in a Pdelay_Resp_Follow_Up message 3. returns the
timestamps t2 and t3 in the Pdelay_Resp and Pdelay_Resp_Follow_Up
messages, respectively
I found that the IXIA master that I used was using option 2 and was
not sending the actual timestamp t2 but sending out 0 instead. At the
same time the Syncs were the actual timestamp as the originTimestamp.
This makes it impossible to use the two remote timestamp values
together to compute the delay using get_raw_delay() in
tsproc_update_offset(). To workaround this I am using the following
patch. (BTW, t2 corresponds to
t4 in the tsproc structure). Instead of calling get_raw_delay() I am
using the previous value of it. There could be better solutions for
this but this is for the review of my initial solution.
Thanks,
Methlal
diff --git a/tsproc.c b/tsproc.c
index a871049..8f0376a 100644
--- a/tsproc.c
+++ b/tsproc.c
@@ -43,6 +43,9 @@ struct tsproc {
tmv_t filtered_delay;
int filtered_delay_valid;
+ /* Last raw delay */
+ tmv_t last_raw_delay;
+
/* Delay filter */
struct filter *delay_filter;
};
@@ -155,6 +158,7 @@ int tsproc_update_delay(struct tsproc *tsp, tmv_t
*delay)
raw_delay = get_raw_delay(tsp);
tsp->filtered_delay = filter_sample(tsp->delay_filter,
raw_delay);
tsp->filtered_delay_valid = 1;
+ tsp->last_raw_delay = raw_delay;
pr_debug("delay filtered %10" PRId64 " raw %10" PRId64,
tmv_to_nanoseconds(tsp->filtered_delay),
@@ -197,14 +201,22 @@ int tsproc_update_offset(struct tsproc *tsp, tmv_t
*offset, double *weight)
if (tmv_is_zero(tsp->t3)) {
return -1;
}
- raw_delay = get_raw_delay(tsp);
+ if (tmv_is_zero(tsp->t4)) { /* Special p2p case */
+ raw_delay = tsp->last_raw_delay;
+ } else {
+ raw_delay = get_raw_delay(tsp);
+ }
delay = raw_delay;
break;
case TSPROC_FILTER_WEIGHT:
if (tmv_is_zero(tsp->t3) ||
!tsp->filtered_delay_valid) {
return -1;
}
- raw_delay = get_raw_delay(tsp);
+ if (tmv_is_zero(tsp->t4)) { /* Special p2p case */
+ raw_delay = tsp->last_raw_delay;
+ } else {
+ raw_delay = get_raw_delay(tsp);
+ }
delay = tsp->filtered_delay;
break;
}
@@ -233,6 +245,7 @@ void tsproc_reset(struct tsproc *tsp, int full)
tsp->t2 = tmv_zero();
tsp->t3 = tmv_zero();
tsp->t4 = tmv_zero();
+ tsp->last_raw_delay = tmv_zero();
if (full) {
tsp->clock_rate_ratio = 1.0;
_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Flinuxptp-devel&data=04%7C01%7Cerez.geva.ext%40siemens.com%7C4bafb02e20484f4a60db08d9ab511167%7C38ae3bcd95794fd4addab42e1495d55a%7C1%7C0%7C637729187197167401%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=vmM%2FduipXZ8p2CEUCCE06rIUKVc%2B38dl37XO1yxzvu8%3D&reserved=0
_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel