> When this returns -EIO, what happens to the data left behind for
> cpsw_ale_dump()?
[...]
> Suppose the give-up path hits the index of the untagged VLAN during
> suspend. Could resume then free or replace that entry, which is the
> failure this patch is meant to prevent?
Yes. In v4 cpsw_ale_dump() returns -EIO if an entry could not be
verified, and am65_cpsw_nuss_suspend() returns that error before it
stops anything, so cpsw_ale_restore() never writes an unverified entry
back. The ethtool register dumps ignore the return value.
> Before this patch, cpsw_ale_add_ucast() could only fail with -ENOMEM,
> and cpsw_ale_del_ucast() only with -ENOENT. Are the callers ready for
> the new -EIO, which means nothing was written to hardware?
Not all of them. -EIO only comes after four read pairs that did not
match. Without this patch the same misread goes unnoticed and the add
or delete works on wrong data, which is the corruption this series
fixes. With it the hardware entry stays as it is and a ratelimited
warning names the index. I would rather not grow this fix into the am65
callers. The give-up path was not hit on hardware (about 309000
multicast joins with v3).
> Could this leave stale VLAN, unicast or multicast entries forwarding
> traffic for state the stack considers removed?
In the give-up case, yes. The alternative is to write back an entry
built from data that could not be verified, which can overwrite the
entry with the contents of another index. That is the failure seen on
hardware, so leaving the entry alone is the smaller harm.
> Is the "am64-cpswxg" ALE dev_id actually limited to AM64/AM62x?
No, thanks for catching it. am65-cpsw-nuss also uses it for J7200,
J721E, J784S4 and J722S. The v4 changelog says so. I keep the flag for
all of them: a verified read returns the same data as before and only
costs the extra register accesses. It was tested on AM625 only.
> Could the free-slot path get an extra check, since that is where a
> false FREE does damage?
The changelog names this limit. In testing the two reads of a failing
pair always differed, so v4 leaves it at that.
> After a flush or an allmulti change, can the ALE keep forwarding
> multicast to a port the stack removed, or keep withholding flooding
> the stack enabled, until the next rx_mode change?
Yes, in the give-up case, for the same reason as above.
The nits on patches 1 and 2 are addressed in v4 as well: patch 1 names
the patch that depends on it and carries its Fixes tag, and the lock
comment in patch 2 says that only the writers of p0_untag_vid_mask are
serialized.
pw-bot: cr