On Thu, Jun 08, 2017 at 11:52:14AM +0200, Richard Cochran wrote:
> I was waiting for Miroslav to comment first ;)
> 
> He did suggest something some time ago.  I have not yet thought much
> about bonding, and so I not yet ready to give an opinion...

My suggestion was to modify the kernel to support timestamping
directly on the bonding master interface, so ptp4l could work with it
as with a real interface (except maybe it would need to reopen the PHC
when the active slave is changed). phc2sys would need to know which
slave interfaces are in the bond, keep their clocks synchronized to
each other and track the active slave.

What Hangbin is suggesting is different in that most of the work is
done in ptp4l and there are no or only minimal changes needed in the
kernel and phc2sys. ptp4l would use the master interface for
networking and slave interfaces for timestamping configuration and
clock control. It would need to know which slave interface is active
and react to changes. I think it makes sense and I like it better than
what I suggested.

The question is if you would be ok with bonding/teaming-specific code
in ptp4l and if you have any suggestions on the design. Should there
be only one port, or should each slave interface has its own port? The
later would work better with phc2sys, but I suspect inactive ports
would have to close their sockets (bound to the master interface), so
only one is open at the time.

As for supporting other bonding modes than active-backup, I think that
would require a completely different approach and I'm not sure if it
actually makes sense with PTP as implemented in linuxptp. Each slave
interface would probably need to have a separate clock, which would
receive only a fraction of the PTP traffic. A single ptp4l instance
would control multiple clocks at the same time and demultiplex PTP
messages from a single socket, or, if a new socket option was
implemented in the kernel to filter outgoing messages by slave
interface, it might be possible to use separate ptp4l instances. In
any case, all requests for bonding support I've seen so far were for
the active-backup mode, so I think it's ok to ignore the other modes
for now.

-- 
Miroslav Lichvar

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to