From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ido Schimmel Subject: Re: [patch net-next 03/10] ipv4: fib_rules: Dump FIB rules when registering FIB notifier Date: Mon, 13 Mar 2017 19:33:41 +0200 Message-ID: <20170313173341.GA6577@splinter.mtl.com> References: <1489390535-2566-1-git-send-email-jiri@resnulli.us> <1489390713-2634-1-git-send-email-jiri@resnulli.us> <1489390713-2634-3-git-send-email-jiri@resnulli.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Jiri Pirko , netdev@vger.kernel.org, davem@davemloft.net, idosch@mellanox.com, mlxsw@mellanox.com, shm@cumulusnetworks.com, kuznet@ms2.inr.ac.ru, jmorris@namei.org, yoshfuji@linux-ipv6.org, kaber@trash.net, lorenzo@google.com, mateusz.bajorski@nokia.com To: David Ahern Return-path: Received: from out1-smtp.messagingengine.com ([66.111.4.25]:39049 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750814AbdCMReg (ORCPT ); Mon, 13 Mar 2017 13:34:36 -0400 Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On Mon, Mar 13, 2017 at 08:52:45AM -0600, David Ahern wrote: > On 3/13/17 1:38 AM, Jiri Pirko wrote: > > From: Ido Schimmel > > > > In commit c3852ef7f2f8 ("ipv4: fib: Replay events when registering FIB > > notifier") we dumped the FIB tables and replayed the events to the > > passed notification block. > > > > However, we merely sent a RULE_ADD notification in case custom rules > > were in use. As explained in previous patches, this approach won't work > > anymore. Instead, we should notify the caller about all the FIB rules > > and let it act accordingly. > > > > Upon registration to the FIB notification chain, replay a RULE_ADD > > notification for each programmed FIB rule, custom or not. The integrity > > of the dump is ensured by the mechanism introduced in the above > > mentioned commit. > > > > Prevent regressions by making sure current listeners correctly sanitize > > the notified rules. > > > > Signed-off-by: Ido Schimmel > > Signed-off-by: Jiri Pirko > > --- > > drivers/net/ethernet/mellanox/mlxsw/Kconfig | 1 + > > drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 11 ++++++++++- > > drivers/net/ethernet/rocker/Kconfig | 2 +- > > drivers/net/ethernet/rocker/rocker_main.c | 15 +++++++++++++-- > > net/ipv4/fib_rules.c | 19 ++++++++++++++++--- > > 5 files changed, 41 insertions(+), 7 deletions(-) > > > > diff --git a/drivers/net/ethernet/mellanox/mlxsw/Kconfig b/drivers/net/ethernet/mellanox/mlxsw/Kconfig > > index ef23eae..a549a89 100644 > > --- a/drivers/net/ethernet/mellanox/mlxsw/Kconfig > > +++ b/drivers/net/ethernet/mellanox/mlxsw/Kconfig > > @@ -73,6 +73,7 @@ config MLXSW_SWITCHX2 > > config MLXSW_SPECTRUM > > tristate "Mellanox Technologies Spectrum support" > > depends on MLXSW_CORE && MLXSW_PCI && NET_SWITCHDEV && VLAN_8021Q > > + depends on IP_MULTIPLE_TABLES > > depends on PSAMPLE || PSAMPLE=n > > select PARMAN > > default m > > Why require multiple tables just b/c the h/w has the ability to support > multiple tables? No... I defined 'struct fib_rule_notifier_info' based on CONFIG_IP_MULTIPLE_TABLES cause I thought it's needed for the embedded 'struct fib_rule', but now that I'm looking again I see that it's not the case. Will drop it. Thanks.