mirror of
https://github.com/openwrt/openwrt.git
synced 2026-11-27 16:50:30 +04:00
realtek: dsa: do not call a route left to the CPU a failure
A route the driver will not offload is reported with -ENODEV or -EOPNOTSUPP, and in both cases otto_l3_fib_add_v4() has already given the destination a row that traps, so the CPU routes it. That is the designed outcome, not an error, but the FIB worker logs "fib_add() failed" for any non-zero return - twice on every RTL931x boot, for the address the initramfs puts on a port before the bridge exists. Keep the shout for a return that means the hardware would not take what the driver did want, and say what it was. Signed-off-by: Carlo Szelinsky <github@szelinsky.de> Link: https://github.com/openwrt/openwrt/pull/26192 Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
This commit is contained in:
1 parent
f1d43d5297
commit
9154fd858f
1 file changed
+9
-2
@@ -3765,8 +3765,15 @@ static void otto_l3_fib_event_work_do(struct work_struct *work)
|
||||
case FIB_EVENT_ENTRY_REPLACE:
|
||||
case FIB_EVENT_ENTRY_APPEND:
|
||||
err = otto_l3_fib_add_v4(ctrl, &fib_work->fen_info);
|
||||
if (err)
|
||||
dev_err(ctrl->dev, "fib_add() failed\n");
|
||||
/* A route the driver will not take is not a failure, and it
|
||||
* says so with -ENODEV or -EOPNOTSUPP: the destination gets a
|
||||
* row that traps and the CPU routes it. Anything else means
|
||||
* the hardware would not take what the driver did want.
|
||||
*/
|
||||
if (err && err != -ENODEV && err != -EOPNOTSUPP)
|
||||
dev_err(ctrl->dev, "fib_add() failed: %d\n", err);
|
||||
else if (err)
|
||||
dev_dbg(ctrl->dev, "route left to the CPU: %d\n", err);
|
||||
|
||||
otto_l3_local_prefix_check(ctrl, &fib_work->fen_info.info);
|
||||
fib_info_put(fib_work->fen_info.fi);
|
||||
|
||||
Reference in new issue
Block a user