From: Jiri Pirko <jiri@resnulli.us>
To: David Ahern <dsahern@gmail.com>
Cc: netdev@vger.kernel.org, jiri@mellanox.com, idosch@mellanox.com,
johannes.berg@intel.com
Subject: Re: [PATCH net-next 3/3] mlxsw: spectrum_router: Return extack message on abort due to fib rules
Date: Thu, 26 Oct 2017 08:26:16 +0200 [thread overview]
Message-ID: <20171026062616.GC1928@nanopsycho.orion> (raw)
In-Reply-To: <1508994485-24533-4-git-send-email-dsahern@gmail.com>
Thu, Oct 26, 2017 at 07:08:05AM CEST, dsahern@gmail.com wrote:
>Adding a FIB rule on a spectrum platform silently aborts FIB offload:
> $ ip ru add pref 99 from all to 192.168.1.1 table 10
> $ dmesg -c
> [ 623.144736] mlxsw_spectrum 0000:03:00.0: FIB abort triggered. Note that FIB entries are no longer being offloaded to this device.
>
>This patch reworks FIB rule handling to return a message to the user:
> $ ip ru add pref 99 from all to 8.8.8.8 table 11
> Error: spectrum: FIB rules not supported. Aborting offload.
>
>spectrum currently only checks whether the fib rule is a default rule or
>an l3mdev rule, both of which it knows how to handle. Any other it aborts
>FIB offload. Since the processing is fairly quick, move the code to inline
>with the user request rather than a work queue to allow a message to be
>returned if the offload is aborted. Change the delete handling to just return
>since it does nothing at the moment.
>
>Signed-off-by: David Ahern <dsahern@gmail.com>
>---
[...]
>+static int mlxsw_sp_router_fib_rule_event(unsigned long event,
>+ struct fib_notifier_info *info,
>+ struct mlxsw_sp *mlxsw_sp)
>+{
>+ struct netlink_ext_ack *extack = info->extack;
>+ struct fib_rule_notifier_info *fr_info;
>+ struct fib_rule *rule;
>+ bool add_unsupported_msg = false;
>+
>+ /* nothing to do at the moment */
>+ if (event == FIB_EVENT_RULE_DEL)
>+ goto out;
>+
>+ fr_info = container_of(info, struct fib_rule_notifier_info, info);
>+ rule = fr_info->rule;
>+
>+ switch (info->family) {
>+ case AF_INET:
>+ if (!fib4_rule_default(rule) && !rule->l3mdev) {
Why don't we abort on removal of default rule?
>+ add_unsupported_msg = true;
>+ mlxsw_sp_router_fib_abort(mlxsw_sp);
>+ }
>+ break;
>+ case AF_INET6:
>+ if (!fib6_rule_default(rule) && !rule->l3mdev) {
>+ add_unsupported_msg = true;
>+ mlxsw_sp_router_fib_abort(mlxsw_sp);
>+ }
>+ break;
>+ case RTNL_FAMILY_IPMR:
>+ if (!ipmr_rule_default(rule) && !rule->l3mdev) {
>+ add_unsupported_msg = true;
>+ mlxsw_sp_router_fib_abort(mlxsw_sp);
>+ }
> break;
next prev parent reply other threads:[~2017-10-26 6:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-26 5:08 [PATCH net-next 0/3] net: Allow non-fatal messages to be passed in extack David Ahern
2017-10-26 5:08 ` [PATCH net-next 1/3] netlink: Allow ext_ack to carry non-error messages David Ahern
2017-10-26 5:08 ` [PATCH net-next 2/3] net: Add extack to fib_notifier_info David Ahern
2017-10-26 5:08 ` [PATCH net-next 3/3] mlxsw: spectrum_router: Return extack message on abort due to fib rules David Ahern
2017-10-26 6:26 ` Jiri Pirko [this message]
2017-10-26 6:40 ` Ido Schimmel
2017-10-26 6:38 ` Ido Schimmel
2017-10-26 15:30 ` David Ahern
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=20171026062616.GC1928@nanopsycho.orion \
--to=jiri@resnulli.us \
--cc=dsahern@gmail.com \
--cc=idosch@mellanox.com \
--cc=jiri@mellanox.com \
--cc=johannes.berg@intel.com \
--cc=netdev@vger.kernel.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).