Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mlxsw: spectrum_router: Don't rely on missing extack to symbolize dump

Currently if info->extack is NULL, mlxsw assumes that the event came
down from dump. Originally, the dump did not propagate the return value
back to the original caller (fib_notifier_register()). However, that is
now happening. So benefit from this and push the error up if it happened.
Remove rule cases in work handlers that are now dead code.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Jiri Pirko and committed by
David S. Miller
3f9e5c11 55c894f7

+1 -21
+1 -21
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
··· 6019 6019 mlxsw_sp_router_fib4_del(mlxsw_sp, &fib_work->fen_info); 6020 6020 fib_info_put(fib_work->fen_info.fi); 6021 6021 break; 6022 - case FIB_EVENT_RULE_ADD: 6023 - /* if we get here, a rule was added that we do not support. 6024 - * just do the fib_abort 6025 - */ 6026 - mlxsw_sp_router_fib_abort(mlxsw_sp); 6027 - break; 6028 6022 case FIB_EVENT_NH_ADD: /* fall through */ 6029 6023 case FIB_EVENT_NH_DEL: 6030 6024 mlxsw_sp_nexthop4_event(mlxsw_sp, fib_work->event, ··· 6058 6064 fib_work->fib6_work.rt_arr, 6059 6065 fib_work->fib6_work.nrt6); 6060 6066 mlxsw_sp_router_fib6_work_fini(&fib_work->fib6_work); 6061 - break; 6062 - case FIB_EVENT_RULE_ADD: 6063 - /* if we get here, a rule was added that we do not support. 6064 - * just do the fib_abort 6065 - */ 6066 - mlxsw_sp_router_fib_abort(mlxsw_sp); 6067 6067 break; 6068 6068 } 6069 6069 rtnl_unlock(); ··· 6099 6111 mlxsw_sp_router_fibmr_vif_del(mlxsw_sp, 6100 6112 &fib_work->ven_info); 6101 6113 dev_put(fib_work->ven_info.dev); 6102 - break; 6103 - case FIB_EVENT_RULE_ADD: 6104 - /* if we get here, a rule was added that we do not support. 6105 - * just do the fib_abort 6106 - */ 6107 - mlxsw_sp_router_fib_abort(mlxsw_sp); 6108 6114 break; 6109 6115 } 6110 6116 rtnl_unlock(); ··· 6244 6262 case FIB_EVENT_RULE_DEL: 6245 6263 err = mlxsw_sp_router_fib_rule_event(event, info, 6246 6264 router->mlxsw_sp); 6247 - if (!err || info->extack) 6248 - return notifier_from_errno(err); 6249 - break; 6265 + return notifier_from_errno(err); 6250 6266 case FIB_EVENT_ENTRY_ADD: 6251 6267 case FIB_EVENT_ENTRY_REPLACE: /* fall through */ 6252 6268 case FIB_EVENT_ENTRY_APPEND: /* fall through */