net: dsa: motorcomm: Report error when FDB fails to add
David Yang
maintainerPATCH 1/1 net: dsa: motorcomm: Report error when FDB fails to add
fdb_add() ignored any errors returned by the hardware (for example, table is full). Return error for that case.
--- drivers/net/dsa/motorcomm/chip.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/net/dsa/motorcomm/chip.c +7 -1
@@ -725,7 +725,13 @@ yt921x_fdb_add(struct yt921x_priv *priv, const unsigned char *addr, u16 vid,if (res)return res; -return yt921x_fdb_wait (priv, &val); + res =yt921x_fdb_wait (priv, &val); +if (res) +return res; +if (val &YT921X_FDB_RESULT_NOTFOUND ) +return -ENOSPC ; + +return 0 ; } static int
Signature · 1 line
2.53.0
[email protected]
AI reviewThis is an automated message. This series looks like a fix, but its commit messages seem to be missing some information:
Hi!
This is an automated message. This series looks like a fix, but its commit messages seem to be missing some information:
- How the issue was discovered, e.g. hit in production, hit during development, syzbot report, manual code inspection, LLM or static analysis tool scan.
- Whether the issue was actually triggered, or is only theoretical (e.g. found by code inspection). If it was triggered please include the symptoms, like the stack trace or error messages.
Please do not repost the series just to address the above. Instead, reply to this email with the missing information, so that reviewers can take it into account. If the series needs another revision for other reasons, please include the information in the commit messages then.
The evaluation is done by an LLM so it may be wrong, if you think that is the case please reply and explain.
Andrew Lunn
maintainerQuoted 5 lines · David Yang
fdb_add()ignored any errors returned by the hardware (for example, table is full). Return error for that case.Fixes 186623f4aa72 ("net: dsa: yt921x: Add support for Motorcomm YT921x")Signed-off-by David Yang <[email protected]>
I'm not sure this deserves a Fixes tag. How many entries does the table take before it is full? Typical home networks have what, 10, 20 devices maximum. A small business network may have a couple of hundred?
What happens if it is full, and you don't return ENOSPC?
Andrew
David Yang
maintainerQuoted 8 lines · Andrew Lunn
Quoted 5 lines · David Yang
fdb_add()ignored any errors returned by the hardware (for example, table is full). Return error for that case.Fixes 186623f4aa72 ("net: dsa: yt921x: Add support for Motorcomm YT921x")Signed-off-by David Yang <[email protected]>
Quoted 8 lines
I'm not sure this deserves a Fixes tag. How many entries does the table take before it is full? Typical home networks have what, 10, 20 devices maximum. A small business network may have a couple of hundred?
What happens if it is full, and you don't return ENOSPC?
Andrew
When full, the error was silently ignored -- the bridge kept the entry marked offloaded while the hardware never stored it.
May indeed be too minor for a Fixes tag -- could drop it in v2 if you prefer.