From: Jiri Pirko <jiri@resnulli.us>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, idosch@mellanox.com, dsahern@gmail.com,
jakub.kicinski@netronome.com, tariqt@mellanox.com,
saeedm@mellanox.com, kuznet@ms2.inr.ac.ru,
yoshfuji@linux-ipv6.org, shuah@kernel.org, mlxsw@mellanox.com
Subject: [patch net-next v2 04/15] mlxsw: spectrum_router: Don't rely on missing extack to symbolize dump
Date: Wed, 2 Oct 2019 18:12:20 +0200 [thread overview]
Message-ID: <20191002161231.2987-5-jiri@resnulli.us> (raw)
In-Reply-To: <20191002161231.2987-1-jiri@resnulli.us>
From: Jiri Pirko <jiri@mellanox.com>
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>
---
.../ethernet/mellanox/mlxsw/spectrum_router.c | 22 +------------------
1 file changed, 1 insertion(+), 21 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
index d0db9ea71323..1eeff1d23b13 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
@@ -6019,12 +6019,6 @@ static void mlxsw_sp_router_fib4_event_work(struct work_struct *work)
mlxsw_sp_router_fib4_del(mlxsw_sp, &fib_work->fen_info);
fib_info_put(fib_work->fen_info.fi);
break;
- case FIB_EVENT_RULE_ADD:
- /* if we get here, a rule was added that we do not support.
- * just do the fib_abort
- */
- mlxsw_sp_router_fib_abort(mlxsw_sp);
- break;
case FIB_EVENT_NH_ADD: /* fall through */
case FIB_EVENT_NH_DEL:
mlxsw_sp_nexthop4_event(mlxsw_sp, fib_work->event,
@@ -6065,12 +6059,6 @@ static void mlxsw_sp_router_fib6_event_work(struct work_struct *work)
fib_work->fib6_work.nrt6);
mlxsw_sp_router_fib6_work_fini(&fib_work->fib6_work);
break;
- case FIB_EVENT_RULE_ADD:
- /* if we get here, a rule was added that we do not support.
- * just do the fib_abort
- */
- mlxsw_sp_router_fib_abort(mlxsw_sp);
- break;
}
rtnl_unlock();
kfree(fib_work);
@@ -6112,12 +6100,6 @@ static void mlxsw_sp_router_fibmr_event_work(struct work_struct *work)
&fib_work->ven_info);
dev_put(fib_work->ven_info.dev);
break;
- case FIB_EVENT_RULE_ADD:
- /* if we get here, a rule was added that we do not support.
- * just do the fib_abort
- */
- mlxsw_sp_router_fib_abort(mlxsw_sp);
- break;
}
rtnl_unlock();
kfree(fib_work);
@@ -6262,9 +6244,7 @@ static int mlxsw_sp_router_fib_event(struct notifier_block *nb,
case FIB_EVENT_RULE_DEL:
err = mlxsw_sp_router_fib_rule_event(event, info,
router->mlxsw_sp);
- if (!err || info->extack)
- return notifier_from_errno(err);
- break;
+ return notifier_from_errno(err);
case FIB_EVENT_ENTRY_ADD:
case FIB_EVENT_ENTRY_REPLACE: /* fall through */
case FIB_EVENT_ENTRY_APPEND: /* fall through */
--
2.21.0
next prev parent reply other threads:[~2019-10-02 16:12 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-02 16:12 [patch net-next v2 00/15] devlink: allow devlink instances to change network namespace Jiri Pirko
2019-10-02 16:12 ` [patch net-next v2 01/15] netdevsim: change fib accounting and limitations to be per-device Jiri Pirko
2019-10-02 16:12 ` [patch net-next v2 02/15] net: fib_notifier: make FIB notifier per-netns Jiri Pirko
2019-10-02 16:12 ` [patch net-next v2 03/15] net: fib_notifier: propagate possible error during fib notifier registration Jiri Pirko
2019-10-02 16:12 ` Jiri Pirko [this message]
2019-10-02 16:12 ` [patch net-next v2 05/15] net: fib_notifier: propagate extack down to the notifier block callback Jiri Pirko
2019-10-02 16:12 ` [patch net-next v2 06/15] net: devlink: export devlink net getter Jiri Pirko
2019-10-02 16:12 ` [patch net-next v2 07/15] mlxsw: spectrum: Take devlink net instead of init_net Jiri Pirko
2019-10-02 16:12 ` [patch net-next v2 08/15] mlxsw: Register port netdevices into net of core Jiri Pirko
2019-10-02 16:12 ` [patch net-next v2 09/15] mlxsw: Propagate extack down to register_fib_notifier() Jiri Pirko
2019-10-02 16:12 ` [patch net-next v2 10/15] netdevsim: add all ports in nsim_dev_create() and del them in destroy() Jiri Pirko
2019-10-02 16:12 ` [patch net-next v2 11/15] netdevsim: implement proper devlink reload Jiri Pirko
2019-10-03 0:38 ` Jakub Kicinski
2019-10-03 5:37 ` Jiri Pirko
2019-10-02 16:12 ` [patch net-next v2 12/15] netdevsim: register port netdevices into net of device Jiri Pirko
2019-10-02 16:12 ` [patch net-next v2 13/15] netdevsim: take devlink net instead of init_net Jiri Pirko
2019-10-02 16:12 ` [patch net-next v2 14/15] net: devlink: allow to change namespaces during reload Jiri Pirko
2019-10-02 16:12 ` [patch net-next v2 15/15] selftests: netdevsim: add tests for devlink reload with resources Jiri Pirko
2019-10-02 16:14 ` [patch iproute2-next v2 1/2] devlink: introduce cmdline option to switch to a different namespace Jiri Pirko
2019-10-02 16:14 ` [patch iproute2-next v2 2/2] devlink: extend reload command to add support for network namespace change Jiri Pirko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191002161231.2987-5-jiri@resnulli.us \
--to=jiri@resnulli.us \
--cc=davem@davemloft.net \
--cc=dsahern@gmail.com \
--cc=idosch@mellanox.com \
--cc=jakub.kicinski@netronome.com \
--cc=kuznet@ms2.inr.ac.ru \
--cc=mlxsw@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=saeedm@mellanox.com \
--cc=shuah@kernel.org \
--cc=tariqt@mellanox.com \
--cc=yoshfuji@linux-ipv6.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).