[etherlab-users] Maximum mailbox size?
Gavin Lambert
gavinl at compacsort.com
Tue Jul 8 03:55:22 CEST 2014
On 8 July 2014, quoth Dave Page:
> A brief look at the SSC suggests the master is responsible for
> specifying the mailbox size each transfer via the Length parameter in
> the mailbox header. The FMMU mailbox protocol requires the last mailbox
> byte to be accessed to hand over the mailbox buffer. So, the fieldbus
> must transfer the full mailbox size (or utilize two transfers?).
Yes, but the point that I was trying to get at is that the master is responsible for configuring the FMMU size (during the INIT=>PREOP transition) in the first place.
While it's supposed to configure it to match the size specified in the SII for the particular slave, I don't think it's unreasonable to treat it as a negotiation -- the SII specifies the preferred size (also the maximum that the slave is prepared to deal with), and the master has its own internal maximum limit (which should be 1486 bytes, but maybe could be less if the master wants to limit memory or bandwidth usage), and when configuring the FMMUs it should be able to set the size to min(max_length_from_slave_sii, max_length_from_master).
Certainly any SSC-based slave will cope with alternate mailbox lengths without issues. Some slaves might support only specific lengths (which is why the SII length should be preferred) but imposing a max limit of 1486 should be harmless.
I suppose it's a tradeoff -- as currently implemented, if a slave does have a corrupt or badly-configured SII then it will lock up the entire master thread, but at least someone will notice that connecting that slave causes a problem and they might disconnect or fix the slave. Whereas if we impose a max limit internally then everything will work as normal and the bad slave configuration might go unnoticed for a while.
I tend to lean toward the latter option though -- making things robust even in the face of bad setup.
More information about the Etherlab-users
mailing list