public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Hannes Frederic Sowa <hannes@stressinduktion.org>
Cc: netdev@vger.kernel.org, davem@davemloft.net, idosch@mellanox.com,
	eladr@mellanox.com, yotamg@mellanox.com, nogahf@mellanox.com,
	arkadis@mellanox.com, ogerlitz@mellanox.com,
	roopa@cumulusnetworks.com, dsa@cumulusnetworks.com,
	nikolay@cumulusnetworks.com, andy@greyhouse.net,
	vivien.didelot@savoirfairelinux.com, andrew@lunn.ch,
	f.fainelli@gmail.com, alexander.h.duyck@intel.com,
	kaber@trash.net
Subject: Re: [patch net-next v2 10/11] mlxsw: spectrum_router: Request a dump of FIB tables during init
Date: Wed, 23 Nov 2016 17:04:53 +0100	[thread overview]
Message-ID: <20161123160453.GB1873@nanopsycho> (raw)
In-Reply-To: <1479916800.4019894.797128001.743EBB6A@webmail.messagingengine.com>

Wed, Nov 23, 2016 at 05:00:00PM CET, hannes@stressinduktion.org wrote:
>On Wed, Nov 23, 2016, at 15:48, Jiri Pirko wrote:
>> From: Ido Schimmel <idosch@mellanox.com>
>> 
>> Make sure the device has a complete view of the FIB tables by invoking
>> their dump during module init.
>> 
>> Signed-off-by: Ido Schimmel <idosch@mellanox.com>
>> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
>> ---
>>  drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 16
>>  ++++++++++++++++
>>  1 file changed, 16 insertions(+)
>> 
>> diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
>> b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
>> index 14bed1d..36a71d2 100644
>> --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
>> +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
>> @@ -2027,6 +2027,21 @@ static int mlxsw_sp_router_fib_event(struct
>> notifier_block *nb,
>>  	return NOTIFY_DONE;
>>  }
>>  
>> +static void mlxsw_sp_router_fib_dump(struct mlxsw_sp *mlxsw_sp)
>> +{
>> +       while (!fib_notifier_dump(&mlxsw_sp->fib_nb)) {
>> +               /* Flush pending FIB notifications and then flush the
>> +                * device's table before requesting another dump. Do
>> +                * that with RTNL held, as FIB notification block is
>> +                * already registered.
>> +                */
>> +               mlxsw_core_flush_owq();
>> +               rtnl_lock();
>> +               mlxsw_sp_router_fib_flush(mlxsw_sp);
>> +               rtnl_unlock();
>> +       }
>> +}
>
>I think it is fine to use this kind of synchronization.
>
>But I think that this part of the logic still belongs into the core

Core does not know how driver handles the offloaded fibs. So only driver
knows how/if he needs to do flush in case of retry.


>kernel. I still think it could happen that we will loop here
>indefinitely because of a lot of routing updates and as such would need
>to abort this loop after a number of tries.

In theory, it is possible, howevery quite unlikely.

>
>I would like that the kernel has one function to do this decision
>instead of later patching all users of this API. Do you think it is
>worth it?

For the reason I stated above, I'm not sure that could be done...

  reply	other threads:[~2016-11-23 16:04 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-23 14:34 [patch net-next v2 00/11] ipv4: fib: Allow modules to dump FIB tables Jiri Pirko
2016-11-23 14:34 ` [patch net-next v2 01/11] ipv4: fib: Export free_fib_info() Jiri Pirko
2016-11-23 14:34 ` [patch net-next v2 02/11] ipv4: fib: Add fib_info_hold() helper Jiri Pirko
2016-11-23 14:34 ` [patch net-next v2 03/11] mlxsw: core: Create an ordered workqueue for FIB offload Jiri Pirko
2016-11-23 14:34 ` [patch net-next v2 04/11] mlxsw: spectrum_router: Implement FIB offload in deferred work Jiri Pirko
2016-11-23 14:34 ` [patch net-next v2 05/11] rocker: Create an ordered workqueue for FIB offload Jiri Pirko
2016-11-23 14:34 ` [patch net-next v2 06/11] rocker: Implement FIB offload in deferred work Jiri Pirko
2016-11-23 14:34 ` [patch net-next v2 07/11] ipv4: fib: Convert FIB notification chain to be atomic Jiri Pirko
2016-11-23 14:34 ` [patch net-next v2 08/11] ipv4: fib: Allow for consistent FIB dumping Jiri Pirko
2016-11-23 14:34 ` [patch net-next v2 09/11] ipv4: fib: Add an API to request a FIB dump Jiri Pirko
2016-11-23 17:47   ` Hannes Frederic Sowa
2016-11-23 19:53     ` Ido Schimmel
2016-11-23 23:04       ` Hannes Frederic Sowa
2016-11-24  8:47         ` Ido Schimmel
2016-11-24 12:34           ` Hannes Frederic Sowa
2016-11-23 14:48 ` [patch net-next v2 10/11] mlxsw: spectrum_router: Request a dump of FIB tables during init Jiri Pirko
2016-11-23 16:00   ` Hannes Frederic Sowa
2016-11-23 16:04     ` Jiri Pirko [this message]
2016-11-23 16:59       ` Hannes Frederic Sowa
2016-11-23 17:04         ` Jiri Pirko
2016-11-23 17:08           ` Hannes Frederic Sowa
2016-11-23 19:22             ` Ido Schimmel
2016-11-23 19:45               ` Jiri Pirko
2016-11-23 14:48 ` [patch net-next v2 11/11] rocker: Register FIB notifier before creating ports 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=20161123160453.GB1873@nanopsycho \
    --to=jiri@resnulli.us \
    --cc=alexander.h.duyck@intel.com \
    --cc=andrew@lunn.ch \
    --cc=andy@greyhouse.net \
    --cc=arkadis@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=dsa@cumulusnetworks.com \
    --cc=eladr@mellanox.com \
    --cc=f.fainelli@gmail.com \
    --cc=hannes@stressinduktion.org \
    --cc=idosch@mellanox.com \
    --cc=kaber@trash.net \
    --cc=netdev@vger.kernel.org \
    --cc=nikolay@cumulusnetworks.com \
    --cc=nogahf@mellanox.com \
    --cc=ogerlitz@mellanox.com \
    --cc=roopa@cumulusnetworks.com \
    --cc=vivien.didelot@savoirfairelinux.com \
    --cc=yotamg@mellanox.com \
    /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