Hi there, I am currently debugging a 2-step P2P_TC system that acts a bit "strangely" (at least according to the current logic in linuxptp): >From time to time, it delays follow-up messages and sends them not 1 sync message too late, but 2 sync messages too late (or more, in even rarer cases).
ptp4l[11163.524]: port_syfufsm: SF_HAVE_SYNC: FUP_MATCH: seqid 17341 ptp4l[11163.549]: port_syfufsm: SF_EMPTY: SYNC_MISMATCH: new seqid 17342 ptp4l[11163.580]: port_syfufsm: SF_HAVE_SYNC: SYNC_MISMATCH: last_syncfup seqid 17342 new seqid 17343 ptp4l[11163.612]: port_syfufsm: SF_HAVE_SYNC: SYNC_MISMATCH: last_syncfup seqid 17343 new seqid 17344 ptp4l[11163.612]: process_follow_up: event FUP_MISMATCH, syfu SF_HAVE_SYNC last sync fup seqid 17344, this fup seqid 17342 ptp4l[11163.612]: port_syfufsm: SF_HAVE_SYNC: FUP_MISMATCH: last_syncfup seqid 17344 new seqid 17342 ptp4l[11163.643]: port_syfufsm: SF_HAVE_FUP: SYNC_MISMATCH: last_syncfup seqid 17342 new seqid 17345 ptp4l[11163.644]: process_follow_up: event FUP_MISMATCH, syfu SF_HAVE_SYNC last sync fup seqid 17345, this fup seqid 17343 ptp4l[11163.644]: port_syfufsm: SF_HAVE_SYNC: FUP_MISMATCH: last_syncfup seqid 17345 new seqid 17343 ptp4l[11163.675]: port_syfufsm: SF_HAVE_FUP: SYNC_MISMATCH: last_syncfup seqid 17343 new seqid 17346 This simple reordering throws off the ptp4l synchronization process completely and irreversibly, as it only has the notion of a "last" sync/fup message (history depth of 1). I am a complete outsider when it comes to the linuxptp codebase, so I figured it's best I asked first. Should I go overboard and implement the history "the right way" (2 queues, one for sync, one for follow-up, each with tail dropping after N seqids, and the FSM tries to iterate through the queues end-to-front after each process_${msg}() function, in its attempt to consume whatever seqid has completed in the meantime - meaning it has received both its sync and fup)? Or is there some "shortcut" I can take to make the synchronization at least recover from reordering? Thanks, -Vladimir _______________________________________________ Linuxptp-users mailing list Linuxptp-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-users