From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ido Schimmel Subject: Re: [PATCH net-next 1/2] mlxsw: spectrum_router: Return an error for non-default FIB rules Date: Tue, 1 May 2018 18:19:27 +0300 Message-ID: <20180501151927.GA20577@splinter.mtl.com> References: <20180501081639.29162-1-idosch@mellanox.com> <20180501081639.29162-2-idosch@mellanox.com> <320c79af-3de6-f012-75a2-e5a7effde9f6@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Ido Schimmel , netdev@vger.kernel.org, davem@davemloft.net, jiri@mellanox.com, mlxsw@mellanox.com To: David Ahern Return-path: Received: from out2-smtp.messagingengine.com ([66.111.4.26]:42661 "EHLO out2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755501AbeEAPTb (ORCPT ); Tue, 1 May 2018 11:19:31 -0400 Content-Disposition: inline In-Reply-To: <320c79af-3de6-f012-75a2-e5a7effde9f6@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: On Tue, May 01, 2018 at 09:16:23AM -0600, David Ahern wrote: > On 5/1/18 2:16 AM, Ido Schimmel wrote: > > Since commit 9776d32537d2 ("net: Move call_fib_rule_notifiers up in > > fib_nl_newrule") it is possible to forbid the installation of > > unsupported FIB rules. > > > > Have mlxsw return an error for non-default FIB rules in addition to the > > existing extack message. > > > > Example: > > # ip rule add from 198.51.100.1 table 10 > > Error: mlxsw_spectrum: FIB rules not supported. > > > > Note that offload is only aborted when non-default FIB rules are already > > installed and merely replayed during module initialization. > > > > Signed-off-by: Ido Schimmel > > --- > > drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 6 +++--- > > 1 file changed, 3 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c > > index 8e4edb634b11..baea97560029 100644 > > --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c > > +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c > > @@ -5899,7 +5899,7 @@ static int mlxsw_sp_router_fib_rule_event(unsigned long event, > > } > > > > if (err < 0) > > - NL_SET_ERR_MSG_MOD(extack, "FIB rules not supported. Aborting offload"); > > + NL_SET_ERR_MSG_MOD(extack, "FIB rules not supported"); > > > > return err; > > shouldn't mlxsw_sp_router_fib_rule_event return -EOPNOTSUPP instead of > -1 (EPERM)? The -1 wasn't visible until now so it didn't matter. Will change to -EOPNOTSUPP in v2. Thanks