Hi Tan Tee Min, Agree that 1588-2019 states that all PTP messages can have TLV. However, I'm not sure that it applies to 802.1AS-2020 because 11.4.1 describes "The PTP messages .. shall each have a header, body, and if present, a suffix that contains one or more TLVs.." 11.4.3.1 describes that SYNC can have TLV when twoStep flag = false, but SYNC shall be as specified in Table 11-8 which has only header and reserved field which shall be transmitted with all zero and ignored by receiver. 11.4.5 states similar way that message shall be as Table 11-12.
Based on this, guess that it will need condition to check another flag that it is AS or not. Do I miss or misunderstand something? Thanks. Woojung > -----Original Message----- > From: Tan Tee Min <tee.min....@linux.intel.com> > Sent: Monday, May 8, 2023 9:43 PM > To: linuxptp-devel@lists.sourceforge.net > Subject: [Linuxptp-devel] [PATCH v2 1/1] msg: append TLV onto all PTP event > messages > > EXTERNAL EMAIL: Do not click links or open attachments unless you know the > content is safe > > According to IEEE Std 1588-2019 Chapter 6.4 PTP message classes, > all PTP messages can be extended by means of a standard Type, > Length, Value (TLV) extension mechanism. > > Avnu conformance tests for 802.1AS-2020 do validate whether the device > can properly ignore unknown TLVs in received PTP messages. > > With the present code, we observed "bad message" error when the device > receives Sync, Pdelay_Req and Pdelay_Resp event messages with unknown > TLV > appended. This error is due to PTP event messages are not enabled/allowed > to carry TLV yet. > > To fix the problem, we have to append TLV onto the PTP event messages. > > v2: Fix commit message > > Signed-off-by: Tan Tee Min <tee.min....@linux.intel.com> > --- > msg.c | 6 +++--- > msg.h | 3 +++ > 2 files changed, 6 insertions(+), 3 deletions(-) > > diff --git a/msg.c b/msg.c > index c2d358b..ab841f0 100644 > --- a/msg.c > +++ b/msg.c > @@ -100,13 +100,13 @@ static uint8_t *msg_suffix(struct ptp_message *m) > { > switch (msg_type(m)) { > case SYNC: > - return NULL; > + return m->sync.suffix; > case DELAY_REQ: > return m->delay_req.suffix; > case PDELAY_REQ: > - return NULL; > + return m->pdelay_req.suffix; > case PDELAY_RESP: > - return NULL; > + return m->pdelay_resp.suffix; > case FOLLOW_UP: > return m->follow_up.suffix; > case DELAY_RESP: > diff --git a/msg.h b/msg.h > index b7423ee..e3744dc 100644 > --- a/msg.h > +++ b/msg.h > @@ -124,6 +124,7 @@ struct announce_msg { > struct sync_msg { > struct ptp_header hdr; > struct Timestamp originTimestamp; > + uint8_t suffix[0]; > } PACKED; > > struct delay_req_msg { > @@ -149,12 +150,14 @@ struct pdelay_req_msg { > struct ptp_header hdr; > struct Timestamp originTimestamp; > struct PortIdentity reserved; > + uint8_t suffix[0]; > } PACKED; > > struct pdelay_resp_msg { > struct ptp_header hdr; > struct Timestamp requestReceiptTimestamp; > struct PortIdentity requestingPortIdentity; > + uint8_t suffix[0]; > } PACKED; > > struct pdelay_resp_fup_msg { > -- > 1.9.1 > > > > _______________________________________________ > Linuxptp-devel mailing list > Linuxptp-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/linuxptp-devel _______________________________________________ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel