I tested a basic 802.1AS type scenario with this v3 patchset on both
ends, and it worked!  We may have more test results in a few days if
my colleague runs a real test suite.

The only caveats were:
 * if I stop a CMLDS client and rerun it, it will receive the CMLDS
notifications twice until the old subscription expires.  If I restart
it again quickly enough it'll receive each notification 3 times.  This
is because pmc_recv doesn't filter by .targetPortIdentity.  It could
but it wouldn't be bullet proof anyway because the PMC port's identity
is based on the pid, which is not unique, so I'm not sure if it's
worth doing.

 * inhibit_delay_req / logMinPdelayReqInterval /
operLogPdelayReqInterval should not be used in the CMLDS client config
(which wouldn't be useful anyway) because they'll affect the
subscription renewals.

 * I had two extra changes, one to always calculate the NRR in the
CMLDS port, and one to handle an exception specified in 802.1AS-2020
section 11.2.17.1 above NOTE 3 -- this can be added later separately
from this CMLDS patchset

Best regards

 configs/802.1as-2020-master-cmlds.cfg    | 19 ++++++++++
 configs/802.1as-2020-master-domain-0.cfg | 43 ++++++++++++++++++++++
 configs/802.1as-2020-slave-cmlds.cfg     | 19 ++++++++++
 configs/802.1as-2020-slave-domain-0.cfg  | 45 ++++++++++++++++++++++++
 msg.h                                    |  3 +-
 port.c                                   |  7 ++--
 6 files changed, 130 insertions(+), 6 deletions(-)
 create mode 100644 configs/802.1as-2020-master-cmlds.cfg
 create mode 100644 configs/802.1as-2020-master-domain-0.cfg
 create mode 100644 configs/802.1as-2020-slave-cmlds.cfg
 create mode 100644 configs/802.1as-2020-slave-domain-0.cfg

diff --git a/configs/802.1as-2020-master-cmlds.cfg
b/configs/802.1as-2020-master-cmlds.cfg
new file mode 100644
index 0000000..2e09c6d
--- /dev/null
+++ b/configs/802.1as-2020-master-cmlds.cfg
@@ -0,0 +1,19 @@
+#
+# Common Mean Link Delay Service (CMLDS) example configuration,
+# containing those attributes which differ from the defaults.
+# See the file default.cfg for the complete list of available options.
+#
+[global]
+# Set this for CMLDS regardless of actual port roles on this node
+clientOnly            1
+free_running            1
+assume_two_step            1
+follow_up_info            1
+asCapable            true
+network_transport        L2
+uds_address            /var/run/master-cmlds
+
+transportSpecific        2
+clockIdentity            000001.0000.800000
+
+delay_mechanism            P2P
diff --git a/configs/802.1as-2020-master-domain-0.cfg
b/configs/802.1as-2020-master-domain-0.cfg
new file mode 100644
index 0000000..0e69565
--- /dev/null
+++ b/configs/802.1as-2020-master-domain-0.cfg
@@ -0,0 +1,43 @@
+#
+# 802.1AS configuration example for a single domain out of many (or not
+# so many) on a multidomain-capable node.  Uses a local CMLDS instance,
+# see configs/802.1as-2020-master-cmlds.cfg.
+#
+[global]
+gmCapable            1
+priority1            248
+priority2            248
+logAnnounceInterval        0
+logSyncInterval            -3
+syncReceiptTimeout        3
+neighborPropDelayThresh        800
+min_neighbor_prop_delay        -20000000
+assume_two_step            1
+path_trace_enabled        1
+follow_up_info            1
+asCapable            true
+network_transport        L2
+BMCA                noop
+# Required to quickly correct Time Jumps in master
+step_threshold            1
+inhibit_announce        1
+operLogSyncInterval        0
+operLogPdelayReqInterval    2
+msg_interval_request        1
+servo_offset_threshold        30
+servo_num_offset_values        10
+
+# Master only bits
+serverOnly            1
+inhibit_announce        1
+
+uds_address            /var/run/master-domain-0
+cmlds.server_address        /var/run/master-cmlds
+# FIXME: must set client_address per port
+cmlds.client_address        /var/run/master-client-0
+
+domainNumber            0
+transportSpecific        1
+clockIdentity            000001.0000.000000
+
+delay_mechanism            COMMON_P2P
diff --git a/configs/802.1as-2020-slave-cmlds.cfg
b/configs/802.1as-2020-slave-cmlds.cfg
new file mode 100644
index 0000000..e78e468
--- /dev/null
+++ b/configs/802.1as-2020-slave-cmlds.cfg
@@ -0,0 +1,19 @@
+#
+# Common Mean Link Delay Service (CMLDS) example configuration,
+# containing those attributes which differ from the defaults.
+# See the file default.cfg for the complete list of available options.
+#
+[global]
+# Set this for CMLDS regardless of actual port roles on this node
+clientOnly            1
+free_running            1
+assume_two_step            1
+follow_up_info            1
+asCapable            true
+network_transport        L2
+uds_address            /var/run/slave-cmlds
+
+transportSpecific        2
+clockIdentity            000002.0000.800000
+
+delay_mechanism            P2P
diff --git a/configs/802.1as-2020-slave-domain-0.cfg
b/configs/802.1as-2020-slave-domain-0.cfg
new file mode 100644
index 0000000..8656e60
--- /dev/null
+++ b/configs/802.1as-2020-slave-domain-0.cfg
@@ -0,0 +1,45 @@
+#
+# 802.1AS configuration example for a single domain out of many (or not
+# so many) on a multidomain-capable node.  Uses a local CMLDS instance,
+# see configs/802.1as-2020-slave-cmlds.cfg.
+#
+[global]
+gmCapable            1
+priority1            248
+priority2            248
+logAnnounceInterval        0
+logSyncInterval            -3
+syncReceiptTimeout        3
+neighborPropDelayThresh        800
+min_neighbor_prop_delay        -20000000
+assume_two_step            1
+path_trace_enabled        1
+follow_up_info            1
+asCapable            true
+network_transport        L2
+BMCA                noop
+# Required to quickly correct Time Jumps in master
+step_threshold            1
+inhibit_announce        1
+operLogSyncInterval        0
+operLogPdelayReqInterval    2
+msg_interval_request        1
+servo_offset_threshold        30
+servo_num_offset_values        10
+
+# Slave only bits
+clientOnly            1
+ignore_source_id        1
+servo_offset_threshold        30
+servo_num_offset_values        10
+
+uds_address            /var/run/slave-domain-0
+cmlds.server_address        /var/run/slave-cmlds
+# FIXME: must set client_address per port
+cmlds.client_address        /var/run/slave-client-0
+
+domainNumber            0
+transportSpecific        1
+clockIdentity            000002.0000.000000
+
+delay_mechanism            COMMON_P2P
diff --git a/msg.h b/msg.h
index 9c80f45..d4294ae 100644
--- a/msg.h
+++ b/msg.h
@@ -38,7 +38,8 @@
 #define MAJOR_VERSION_MASK    0x0f

 /* Values for the transportSpecific field */
-#define TS_IEEE_8021AS (1<<4)
+#define TS_IEEE_8021AS    (1<<4)
+#define TS_CMLDS    (2<<4)

 /* Values for the messageType field */
 #define SYNC                  0x0
diff --git a/port.c b/port.c
index e2ebaeb..c5c31d8 100644
--- a/port.c
+++ b/port.c
@@ -2424,9 +2424,6 @@ int process_pdelay_req(struct port *p, struct
ptp_message *m)
         return -1;
     }

-    if (p->delayMechanism == DM_COMMON_P2P) {
-        return 0;
-    }
     if (p->delayMechanism == DM_E2E) {
         pr_warning("%s: pdelay_req on E2E port", p->log_name);
         return 0;
@@ -2445,7 +2442,7 @@ int process_pdelay_req(struct port *p, struct
ptp_message *m)
             p->peer_portid_valid = 0;
             port_capable(p);
         }
-    } else {
+    } else if (p->delayMechanism != DM_COMMON_P2P) {
         p->peer_portid_valid = 1;
         p->peer_portid = m->header.sourcePortIdentity;
         pr_debug("%s: peer port id set to %s", p->log_name,
@@ -2597,7 +2594,7 @@ calc:
         t3c = tmv_add(t3, tmv_add(c1, c2));
     }

-    if (p->follow_up_info)
+    if (p->follow_up_info || p->transportSpecific == TS_CMLDS) /* FIXME */
         port_nrate_calculate(p, t3c, t4);

     tsproc_set_clock_rate_ratio(p->tsproc, p->nrate.ratio *
-- 
2.42.0

On Mon, 4 Dec 2023 at 22:51, Andrew Zaborowski
<andrew.zaborow...@intel.com> wrote:
>
> On Sun, 3 Dec 2023 at 00:39, Richard Cochran <richardcoch...@gmail.com> wrote:
> > +# Common Mean Link Delay Service (CMLDS) example configuration for a
> > +# CMLDS Link Port, containing those attributes which differ from the
>
> While there's only one Link Port here I wouldn't mention this because
> the CMLDS config basically has to cover all of the ports.
>
> > +# defaults.  See the file, default.cfg, for the complete list of
> > +# available options.
> > +#
> > +[global]
> > +clientOnly                     1
> > +clockIdentity                  C37D50.0000.000000
> > +free_running                   1
> > +ignore_transport_specific      1
>
> I assume ignore_transport_specific can be dropped in this version.
>
> > +transportSpecific              2
> > +uds_address                    /var/run/cmlds_server
> > +
> > +[eth1]
> > +delay_mechanism        P2P
>
> This line has to be the same for all interfaces in use by the CMLDS so
> I'd move this to [global] to avoid repetition.
>
> This way you basically have nothing port-specific to configure and can
> pass the interface names on the command line instead of listing here.
> On the client side cmlds.client_address will not allow this because I
> believe the source address has to be different for each port's socket.
> I thought (even before this came up) it would be nice for uds_address
> to default to something that includes the domainNumber, and now for
> cmlds.client_address to include the domainNumber and port number.
>
> I'm going to try test this patchset in an 802.1AS configuration and report 
> back.
>
> Best regards


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

Reply via email to