Re: [Linuxptp-devel] [v2] msg: bump to IEEE 1588-2019 version

2021-02-28 Thread Y.b. Lu
> -Original Message-
> From: Richard Cochran 
> Sent: Friday, February 26, 2021 10:58 PM
> To: Y.b. Lu 
> Cc: linuxptp-devel@lists.sourceforge.net; Miroslav Lichvar
> 
> Subject: Re: [Linuxptp-devel] [v2] msg: bump to IEEE 1588-2019 version
> 
> On Fri, Feb 26, 2021 at 02:42:40AM +, Y.b. Lu wrote:
> > My fault. I Just forgot the message printed. How about,
> >
> > versionNumber   2
> > minorVersionNumber  1
> >
> > This may match field definition in standard. Considering it's only message
> printed, I think either is ok.
> > What do you think?
> 
> I prefer keeping the same number of lines and words in the ascii
> output, like this:
> 
>   versionNumber 2 (older pmc)
>   versionNumber 2.1   (new pmc)
> 
> Why?
> 
> Because that makes life easier for people who have scripts that parse
> the ascii output.  The needed changes are smaller.

Thank you very much. Sent v3.

> 
> Thanks,
> Richard


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


Re: [Linuxptp-devel] [v2] msg: bump to IEEE 1588-2019 version

2021-02-26 Thread Richard Cochran
On Fri, Feb 26, 2021 at 02:42:40AM +, Y.b. Lu wrote:
> My fault. I Just forgot the message printed. How about,
> 
> versionNumber   2
> minorVersionNumber  1
> 
> This may match field definition in standard. Considering it's only message 
> printed, I think either is ok.
> What do you think?

I prefer keeping the same number of lines and words in the ascii
output, like this:

versionNumber 2 (older pmc)
versionNumber 2.1   (new pmc)

Why?

Because that makes life easier for people who have scripts that parse
the ascii output.  The needed changes are smaller.

Thanks,
Richard


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


Re: [Linuxptp-devel] [v2] msg: bump to IEEE 1588-2019 version

2021-02-25 Thread Y.b. Lu
> -Original Message-
> From: Richard Cochran 
> Sent: Friday, February 26, 2021 1:09 AM
> To: Y.b. Lu 
> Cc: linuxptp-devel@lists.sourceforge.net; Miroslav Lichvar
> 
> Subject: Re: [Linuxptp-devel] [v2] msg: bump to IEEE 1588-2019 version
> 
> On Thu, Feb 25, 2021 at 03:20:41PM +0800, Yangbo Lu wrote:
> > IEEE 1588-2019 specified new UInteger4 type minorVersionPTP field
> > in header, and minorVersionNumber data in portDS. It has the value
> > 1 for IEEE 1588-2019, and has the value 0 for IEEE 1588-2008.
> >
> > This patch is to bump to IEEE 1588-2019 version directly in message,
> > considering v2.1 and even future v2.x are all backward compatible.
> >
> > Signed-off-by: Yangbo Lu 
> > ---
> > Changes for v2:
> > - Made v2.1 as macros.
> 
> I really like this change.  It is short and sweet.
> 
> However, now the test suite fails on 20-pmc.
> 
> checking pmc output:BAD
> sending: GET PORT_DATA_SET
> 123456.fffe.780102-1 seq 0 RESPONSE MANAGEMENT
> PORT_DATA_SET
> portIdentity123456.fffe.780102-1
> portState   SLAVE
> logMinDelayReqInterval  0
> peerMeanPathDelay   0
> logAnnounceInterval 1
> announceReceiptTimeout  3
> logSyncInterval 0
> delayMechanism  1
> logMinPdelayReqInterval 0
> versionNumber   18
> 
> I think we should have pmc print versionNumber 2.1 here (format %u.%u)
> and then ask Miroslav to adapt the test suite...

My fault. I Just forgot the message printed. How about,

versionNumber   2
minorVersionNumber  1

This may match field definition in standard. Considering it's only message 
printed, I think either is ok.
What do you think?
Thanks.

> 
> Miroslav, I'm thinking the way to handle this in the test suite is to
> accept both versionNumber 2 and versionNumber 2.1.
> 
> Thoughts?
> 
> Thanks,
> Richard



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


Re: [Linuxptp-devel] [v2] msg: bump to IEEE 1588-2019 version

2021-02-25 Thread Miroslav Lichvar
On Thu, Feb 25, 2021 at 09:09:23AM -0800, Richard Cochran wrote:
> I think we should have pmc print versionNumber 2.1 here (format %u.%u)
> and then ask Miroslav to adapt the test suite...
> 
> Miroslav, I'm thinking the way to handle this in the test suite is to
> accept both versionNumber 2 and versionNumber 2.1.

Works for me. The test is using regexps, so easy to match multiple
strings. There are already some instances of that. I'll update it.

-- 
Miroslav Lichvar



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


Re: [Linuxptp-devel] [v2] msg: bump to IEEE 1588-2019 version

2021-02-25 Thread Richard Cochran
On Thu, Feb 25, 2021 at 03:20:41PM +0800, Yangbo Lu wrote:
> IEEE 1588-2019 specified new UInteger4 type minorVersionPTP field
> in header, and minorVersionNumber data in portDS. It has the value
> 1 for IEEE 1588-2019, and has the value 0 for IEEE 1588-2008.
> 
> This patch is to bump to IEEE 1588-2019 version directly in message,
> considering v2.1 and even future v2.x are all backward compatible.
> 
> Signed-off-by: Yangbo Lu 
> ---
> Changes for v2:
>   - Made v2.1 as macros.

I really like this change.  It is short and sweet.

However, now the test suite fails on 20-pmc.

checking pmc output:BAD
sending: GET PORT_DATA_SET
123456.fffe.780102-1 seq 0 RESPONSE MANAGEMENT PORT_DATA_SET 
portIdentity123456.fffe.780102-1
portState   SLAVE
logMinDelayReqInterval  0
peerMeanPathDelay   0
logAnnounceInterval 1
announceReceiptTimeout  3
logSyncInterval 0
delayMechanism  1
logMinPdelayReqInterval 0
versionNumber   18

I think we should have pmc print versionNumber 2.1 here (format %u.%u)
and then ask Miroslav to adapt the test suite...

Miroslav, I'm thinking the way to handle this in the test suite is to
accept both versionNumber 2 and versionNumber 2.1.

Thoughts?

Thanks,
Richard



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


[Linuxptp-devel] [v2] msg: bump to IEEE 1588-2019 version

2021-02-24 Thread Yangbo Lu
IEEE 1588-2019 specified new UInteger4 type minorVersionPTP field
in header, and minorVersionNumber data in portDS. It has the value
1 for IEEE 1588-2019, and has the value 0 for IEEE 1588-2008.

This patch is to bump to IEEE 1588-2019 version directly in message,
considering v2.1 and even future v2.x are all backward compatible.

Signed-off-by: Yangbo Lu 
---
Changes for v2:
- Made v2.1 as macros.
---
 msg.c | 5 +
 msg.h | 9 +++--
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/msg.c b/msg.c
index d1619d4..c4516ad 100644
--- a/msg.c
+++ b/msg.c
@@ -27,9 +27,6 @@
 #include "print.h"
 #include "tlv.h"
 
-#define VERSION_MASK 0x0f
-#define VERSION  0x02
-
 int assume_two_step = 0;
 
 /*
@@ -80,7 +77,7 @@ static void announce_post_recv(struct announce_msg *m)
 
 static int hdr_post_recv(struct ptp_header *m)
 {
-   if ((m->ver & VERSION_MASK) != VERSION)
+   if ((m->ver & MAJOR_VERSION_MASK) != PTP_MAJOR_VERSION)
return -EPROTO;
m->messageLength = ntohs(m->messageLength);
m->correction = net2host64(m->correction);
diff --git a/msg.h b/msg.h
index a71df16..b7423ee 100644
--- a/msg.h
+++ b/msg.h
@@ -30,7 +30,12 @@
 #include "tlv.h"
 #include "tmv.h"
 
-#define PTP_VERSION 2
+/* Version definition for IEEE 1588-2019 */
+#define PTP_MAJOR_VERSION  2
+#define PTP_MINOR_VERSION  1
+#define PTP_VERSION(PTP_MINOR_VERSION << 4 | PTP_MAJOR_VERSION)
+
+#define MAJOR_VERSION_MASK 0x0f
 
 /* Values for the messageType field */
 #define SYNC  0x0
@@ -89,7 +94,7 @@ enum controlField {
 
 struct ptp_header {
uint8_t tsmt; /* transportSpecific | messageType */
-   uint8_t ver;  /* reserved  | versionPTP  */
+   uint8_t ver;  /* minorVersionPTP   | versionPTP  */
UInteger16  messageLength;
UInteger8   domainNumber;
Octet   reserved1;
-- 
2.25.1



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