Hi Maciek,

Thank you for the feedback.

On Tue, 6 Jun 2023 10:02:40 +0200, Maciek Machnikowski wrote:

> Can we do the #define for that instead of (1<<4)?

Yes, I can do that.

> Why we require clock domain to be 0? AFIK the 802.1AS-2020 added
> support for multiple domains.
> Also the comment talks that the code should check the
> ptp_header.reserved1, but the code doesn't follow that.

I think I was confused by some wording in 802.1AS-2020. Which made me
think that this check was necessary. However, after a closer reading of
the sections below, I think you are correct, that check can probably be
removed. The following excerpts are included to justify this.

802.1AS-2020 section 8.1:
    A time-aware system shall support one or more domains, each with a
    distinct domain number in the range 0 through 127. A time-aware
    system shall support the domain whose domain number is 0, and that
    domain number shall not be changed to a nonzero value. Unless
    otherwise specified in this standard, the operation of gPTP and the
    timescale in any given domain is independent of operation in any
    other domain.

    The value of majorSdoId [aka transportSpecific] for a gPTP domain
    shall be 0x1.

802.1AS-2020 section 11.2.17.1:
    The value of majorSdoId for the CMLDS shall be 0x2.

802.1AS-2020 section 11.4.2.4:
    The domainNumber for Pdelay_Req, Pdelay_Resp, and
    Pdelay_Resp_Follow_Up messages shall be 0.

802.1AS-2020 section 11.2.14.1:
    If the time-aware system implements more than one domain, these two
    state machines shall provide a Common Mean Link Delay Service
    (CMLDS) . . . If the time-aware system implements one domain (the
    domainNumber of this domain is 0; see 8.1), these two state machines
    may provide the CMLDS; however, if they do not provide the CMLDS
    (i.e., if only the PTP Instance-specific peer delay mechanism is
    provided), they shall be invoked on domain 0. In other words, if the
    domain number is not 0, portDS.delayMechanism (see Table 14-8 in
    14.8.5) must not be P2P.

The statement, "if the domain number is not 0, portDS.delayMechanism
must not be P2P" led me to check the domain. (P2P here corresponds to
the 802.1AS computation whereas COMMON_P2P is the alternative that uses
the 1588 computation.)

I guess what this all is trying to convey is that since peer delay
messages from a non-zero clock domain, are required to be invoked on
domain 0 when their transportSpecific value is 1, if we see a non-zero
domain number in a peer delay message we can assume that the message is
either malformed or has a transportSpecific value not equal to 1.

I wish the wording was a little more straightforward, but I think this
all ultimately means: use the 802.1AS computation if and only if the
transportSpecific value is 1.

I will follow this email up with a modified patch that does this and
uses a #define for the transportSpecific check.

Thanks,

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

Reply via email to