The latest 802.1AS has clarified ptpTimescale flag is only used for Announce. 
For all other messages, it should be FALSE (and still ignored on reception). 
Thus, the patch should not be the default. I agree with Jacob that a use of a 
flag may be better to allow interop with other gPTP implementations, if 
required.

Regards,
Greg

-----Original Message-----
From: Jacob Keller <jacob.e.kel...@intel.com> 
Sent: June 14, 2021 1:24 PM
To: linuxptp-devel@lists.sourceforge.net
Subject: Re: [Linuxptp-devel] [PATCH 2/2] Add setting of PTP_TIMESCALE flag



On 6/14/2021 5:03 AM, Miklas, Marcin via Linuxptp-devel wrote:
> From: Marcin Miklas <marcin.mik...@harman.com>
> 
> In gPTP PTP_TIMESCALE flag should be set to 1. It looks like the flags 
> where not properly set for any of messages used in gPTP.
> 
> Some of the automotive gPTP bridges where rejecting the PDelayReq 
> messages because of missing flag.
> 
> I would say that both linuxptp and the bridge doesn't conform to gPTP 
> specification where it is said that the PTP_TIMESCALE should be set to 
> 1 and ignored on reception.
> 

If I recall, this has been discussed on the list multiple times before.

https://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsourceforge.net%2Fp%2Flinuxptp%2Fmailman%2Fmessage%2F34977023%2F&amp;data=04%7C01%7Cgreg.armstrong.uw%40renesas.com%7Cb75bed15e76447ee90ca08d92f597610%7C53d82571da1947e49cb4625a166a4a2a%7C0%7C0%7C637592883546134077%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=mQsYdNT4%2FoGcra850CRlM%2BufYLSfRUvwhKY7V8UnXqo%3D&amp;reserved=0

According to the normal 1588 standard, the bit is not supposed to be set for 
these messages.

Perhaps an optional configuration to set these would be acceptable though. 
(Then the gPTP config file could use that flag to make sure it is set)

> Signed-off-by: Marcin Miklas <marcin.mik...@harman.com>
> ---
>  port.c           | 5 +++++
>  port_signaling.c | 1 +
>  2 files changed, 6 insertions(+)
> 
> diff --git a/port.c b/port.c
> index 8175f28..f906a6c 100644
> --- a/port.c
> +++ b/port.c
> @@ -1362,6 +1362,7 @@ static int port_pdelay_request(struct port *p)
>       msg->header.ver                = PTP_VERSION;
>       msg->header.messageLength      = sizeof(struct pdelay_req_msg);
>       msg->header.domainNumber       = clock_domain_number(p->clock);
> +     msg->header.flagField[1]       = clock_time_properties(p->clock).flags;
>       msg->header.correction         = -p->asymmetry;
>       msg->header.sourcePortIdentity = p->portIdentity;
>       msg->header.sequenceId         = p->seqnum.delayreq++;
> @@ -1556,6 +1557,7 @@ int port_tx_sync(struct port *p, struct address *dst)
>       msg->header.ver                = PTP_VERSION;
>       msg->header.messageLength      = sizeof(struct sync_msg);
>       msg->header.domainNumber       = clock_domain_number(p->clock);
> +     msg->header.flagField[1]       = clock_time_properties(p->clock).flags;
>       msg->header.sourcePortIdentity = p->portIdentity;
>       msg->header.sequenceId         = p->seqnum.sync++;
>       msg->header.control            = CTL_SYNC;
> @@ -1592,6 +1594,7 @@ int port_tx_sync(struct port *p, struct address *dst)
>       fup->header.ver                = PTP_VERSION;
>       fup->header.messageLength      = sizeof(struct follow_up_msg);
>       fup->header.domainNumber       = clock_domain_number(p->clock);
> +     fup->header.flagField[1]       = clock_time_properties(p->clock).flags;
>       fup->header.sourcePortIdentity = p->portIdentity;
>       fup->header.sequenceId         = p->seqnum.sync - 1;
>       fup->header.control            = CTL_FOLLOW_UP;
> @@ -2123,6 +2126,7 @@ int process_pdelay_req(struct port *p, struct 
> ptp_message *m)
>       rsp->header.ver                = PTP_VERSION;
>       rsp->header.messageLength      = sizeof(struct pdelay_resp_msg);
>       rsp->header.domainNumber       = m->header.domainNumber;
> +     rsp->header.flagField[1]       = clock_time_properties(p->clock).flags;
>       rsp->header.sourcePortIdentity = p->portIdentity;
>       rsp->header.sequenceId         = m->header.sequenceId;
>       rsp->header.control            = CTL_OTHER;
> @@ -2170,6 +2174,7 @@ int process_pdelay_req(struct port *p, struct 
> ptp_message *m)
>       fup->header.ver                = PTP_VERSION;
>       fup->header.messageLength      = sizeof(struct pdelay_resp_fup_msg);
>       fup->header.domainNumber       = m->header.domainNumber;
> +     fup->header.flagField[1]       = clock_time_properties(p->clock).flags;
>       fup->header.correction         = m->header.correction;
>       fup->header.sourcePortIdentity = p->portIdentity;
>       fup->header.sequenceId         = m->header.sequenceId;
> diff --git a/port_signaling.c b/port_signaling.c index 
> ed217c0..c76bfdf 100644
> --- a/port_signaling.c
> +++ b/port_signaling.c
> @@ -44,6 +44,7 @@ struct ptp_message *port_signaling_construct(struct port *p,
>       msg->header.ver                = PTP_VERSION;
>       msg->header.messageLength      = sizeof(struct signaling_msg);
>       msg->header.domainNumber       = clock_domain_number(p->clock);
> +     msg->header.flagField[1]       = clock_time_properties(p->clock).flags;
>       msg->header.sourcePortIdentity = p->portIdentity;
>       msg->header.sequenceId         = p->seqnum.signaling++;
>       msg->header.control            = CTL_OTHER;
> 


_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Flinuxptp-devel&amp;data=04%7C01%7Cgreg.armstrong.uw%40renesas.com%7Cb75bed15e76447ee90ca08d92f597610%7C53d82571da1947e49cb4625a166a4a2a%7C0%7C0%7C637592883546144040%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=CZP6LHcbLgDW05PiDFObpdaVlqbI1hsbZF9b9aKyiUw%3D&amp;reserved=0


_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to