From: Ido Schimmel Date: Wed, 2 May 2018 07:17:35 +0000 (+0300) Subject: mlxsw: spectrum_router: Return an error for routes added after abort X-Git-Tag: v4.19~872^2~324^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=50d10711cf1b0bf82f274b0901f54e7ff030b740;p=platform%2Fkernel%2Flinux-rpi.git mlxsw: spectrum_router: Return an error for routes added after abort We currently do not perform accounting in the driver and thus can't reject routes before resources are exceeded. However, in order to make users aware of the fact that routes are no longer offloaded we can return an error for routes configured after the abort mechanism was triggered. Signed-off-by: Ido Schimmel Acked-by: David Ahern Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c index added38..8028d22 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c @@ -5928,6 +5928,13 @@ static int mlxsw_sp_router_fib_event(struct notifier_block *nb, router->mlxsw_sp); if (!err || info->extack) return notifier_from_errno(err); + break; + case FIB_EVENT_ENTRY_ADD: + if (router->aborted) { + NL_SET_ERR_MSG_MOD(info->extack, "FIB offload was aborted. Not configuring route"); + return notifier_from_errno(-EINVAL); + } + break; } fib_work = kzalloc(sizeof(*fib_work), GFP_ATOMIC);