Hello Jake Am Mittwoch, dem 05.07.2023 um 10:50 -0700 schrieb Jacob Keller:
On 7/4/2023 3:30 AM, Stephan Wurm wrote: Standard IEC 21439-3:2016 Appendix A extends the PTPv2 standard by the definition of doubly attached clocks (DAC) via redundant ports (either connected by HSR or PRP). Therefore, the state machine is extended by state PASSIVE_SLAVE and transition PSLAVE. In order to take advantage of the DAC feature, two interfaces need to be configured as redundant port by explicitly selecting the respective other interface via the `paired_interface` configuration option. The new state is reported as PASSIVE via the management interface, remaining compatible with the PTPv2 standard. Signed-off-by: Stephan Wurm <stephan.w...@a-eberle.de<mailto:stephan.w...@a-eberle.de>> --- bmc.c | 10 ++++++++ clock.c | 4 ++++ config.c | 1 + e2e_tc.c | 1 + fsm.c | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ fsm.h | 2 ++ p2p_tc.c | 2 ++ port.c | 52 ++++++++++++++++++++++++++++++++++++---- port.h | 17 +++++++++++++ port_private.h | 4 ++++ port_signaling.c | 1 + tc.c | 2 ++ unicast_service.c | 1 + util.c | 4 +++- 14 files changed, 167 insertions(+), 5 deletions(-) @@ -3406,6 +3427,10 @@ struct port *port_open(const char *phc_device, config_get_int(cfg, p->name, "power_profile.2017.totalTimeInaccuracy"); p->slave_event_monitor = clock_slave_monitor(clock); + p->paired_interface = config_get_string(cfg, p->name, "paired_interface"); + p->prpPairedPort = UINT16_MAX; + p->paired_port = NULL; + if (!port_is_uds(p) && unicast_client_initialize(p)) { goto err_transport; } @@ -3548,3 +3573,22 @@ void port_update_unicast_state(struct port *p) p->unicast_state_dirty = false; } } + +void port_pair(struct port *p, struct port *o) +{ + if ((strncmp(p->paired_interface, interface_name(o->iface), + MAX_IFNAME_SIZE) == 0) && + (strncmp(o->paired_interface, interface_name(p->iface), + MAX_IFNAME_SIZE) == 0)) { + p->paired_port = o; + p->prpPairedPort = portnum(o); + o->paired_port = p; + o->prpPairedPort = portnum(p); + pr_info("Created redundancy pair from ports %s and %s", p->name, o->name); + } Given the name "doubly-attached clock" I would have assumed we would need to check that both ports are tied to the same PTP hardware clock. Is that not the case? At least the IEC62439-3 specification does not handle this. In fact, I performed my first tests on a hardware with shared PHC between both interfaces of the doubly-attached (redundant) setup. If they are not tied to the same clock, how do you ensure the two separate clocks are actually in sync with each other? I guess if both clocks are synchronized simultaneously with the GM then it would be within some tolerance, so perhaps thats ok. As both interfaces keep synchronizing to the same GM, the impact might indeed be negligible. In my recent test setup the interfaces have individual PHCs, so I can try to have a deeper look into that question. Thanks for your feedback Stephan
_______________________________________________ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel