xmos / lib_tsn

Time sensitive networking library
Other
48 stars 29 forks source link

Listener converting Talker Failed to Advertise makes itself a second talker #26

Closed larry-xmos closed 7 years ago

larry-xmos commented 7 years ago

Currently both talker and listener sides of a connected stream try to convert Talker Failed to Advertise once their network ports have gone of out SRP boundary. This code generates a MAD Join of the Advertise attribute. This is fine on talker, but on listener it effectively creates a second talker of the same stream, because that listener will begin declaring identical Talker Advertise.

I have seen X440 switch rightly get confused by seeing two talkers for the same stream.

larry-xmos commented 7 years ago

Code in mrp_periodic that does the Advertise/Failed conversions comes from the original multi-port (e.g. daisy chain) implementation. It may need changing for single-port end stations.

A workaround is to mark the Advertise attribute as here when it is created and only convert attributes marked as here.

  1. Pass in 1 to mrp_attribute_init instead of 0 in avb_srp_join_listener_attrs where the Talker Advertise attribute is created

  2. Test for attrs[j].here in mrp_periodic where it is converting Talker Failed to Advertise (see "Talker Failed -> Advertise for stream")

larry-xmos commented 7 years ago

Re-joining Advertise converted from Failed has been added in 3801a43fd

Code that, once a listener re-joins domain, makes it aware of talker, comes from 05023b27 and e6e04fb3d

larry-xmos commented 7 years ago

I have seen MOTU 5-port switch also getting confused. The MOTU switch has no management interface to look closely at state, but would be no longer forwarding 1722 traffic when the unexpected Talker Advertise appears.

larry-xmos commented 7 years ago

Addressed in 26623fe by setting the here flag correctly. Listeners set here flag to 0 for Talker Advertise or Failed attributes (and listeners set here flag to 0 for Listener Ready attributes). In the Advertise-Failed converting code we only do the conversion if the Talker attribute has here flag set.