[etherlab-dev] Multiple mailbox protocols and other issues

Gavin Lambert gavinl at compacsort.com
Tue Mar 3 01:08:19 CET 2015


On 3 March 2015 01:49, quoth Knud Baastrup:
> Thanks, attached updated patches. See inline comments.

Looks good, as far as I can see. :)

Although speaking of syslog spam, I'm getting quite a lot of "Busy -
processing internal SDO request!" now.

>> Although speaking of the EC_REGALIAS code, if that's enabled and if the
>> register 0x0012 alias is different from the SII alias, then this patch
might
>> malfunction (it should probably skip reading the SII alias and go
straight
>> for the register).  Having said that, normally the two should be the
same,
>> unless someone is in the process of changing the alias (in which case
>> rebooting the slave afterwards should "fix" everything).  There might be
some
>> odd slaves out there though, which could be why EC_REGALIAS was added in
the
>> first place..?
>
> The patch should not be malfunctioning, but yes if alias (or a serial
> number) is updated after a re-scan the stored sii_image cannot be matched
in
> the coming re-scan and a new sii_image will be created for that particular
> module.

The issue would be if some slave always had some wrong value in its SII but
loaded some other value to register 0x0012 on startup (eg. from onboard
dipswitches).  This is not as unlikely as it sounds as it can be quite
awkward for the slave to access its own SII, especially with the default
Etherlab configuration (EC_SII_ASSIGN is not defined by default, and I'm
fairly sure it's not implemented correctly anyway).  This could either work
by coincidence (if the "wrong" value was still unique), or cause either a
cache miss or in the worst case a hit on the wrong data (if that alias value
is shared with another slave).

Fortunately the standards require that in this case the "wrong SII value"
must be zero, which would just make your patch ignore the alias instead of
getting an invalid cache hit, but it's always possible there's some slave
that violates this.  (Also the standard says that in case they're both
non-zero it doesn't need to signal an error until the INIT->PREOP
transition, and the scan may occur before this.)

So I was thinking that in the EC_REGALIAS case your patch should just read
register 0x0012 sooner instead of reading the SII alias at first and then
reading 0x0012 later (but not using the latter for the SII lookup).  It'd
save several network cycles too.

Having said that, I don't know how common use of EC_REGALIAS is (I don't use
it myself).  Maybe it doesn't really matter.





More information about the Etherlab-dev mailing list