From: Ido Schimmel <idosch@idosch.org>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, jiri@mellanox.com,
mlxsw@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, kuznet@ms2.inr.ac.ru,
jmorris@namei.org, yoshfuji@linux-ipv6.org, kaber@trash.net,
Ido Schimmel <idosch@mellanox.com>
Subject: Re: [PATCH net-next v2] ipv4: fib: Replay events when registering FIB notifier
Date: Tue, 1 Nov 2016 00:57:37 +0200 [thread overview]
Message-ID: <20161031225737.7nfoy4ka3ydzhptq@splinter> (raw)
In-Reply-To: <1477949046.7065.320.camel@edumazet-glaptop3.roam.corp.google.com>
On Mon, Oct 31, 2016 at 02:24:06PM -0700, Eric Dumazet wrote:
> On Mon, 2016-10-31 at 23:13 +0200, idosch@idosch.org wrote:
> > From: Ido Schimmel <idosch@mellanox.com>
> >
> > When registering a FIB notifier block we should notify the caller of
> > already existing FIB entries and rules, as it would otherwise have an
> > incomplete view of the FIB tables. This is especially important for
> > switchdev drivers that support FIB offloads. Failing to notify them of
> > existing entries may lead to packet loss.
> >
> > Upon registration, walk the leafs of all the routing tables and for each
> > leaf send notification of existing FIB aliases. Similarly, when
> > unregistering the notifier synthesize a deletion event, thereby
> > relieving potential callers from the need to perform cleanup.
> >
> > The above is consistent with the netdevice notification chain, where
> > "registration and up events are replayed to the new notifier" upon
> > registration.
> >
> > Signed-off-by: Ido Schimmel <idosch@mellanox.com>
> > Reviewed-by: Jiri Pirko <jiri@mellanox.com>
>
> How well will this work for large FIB tables ?
>
> Holding rtnl while sending thousands of skb will prevent consumers to
> make progress ?
Can you please clarify what do you mean by "while sending thousands of
skb"? This patch doesn't generate notifications to user space, but
instead invokes notification routines inside the kernel. I probably
misunderstood you.
Are you suggesting this be done using RCU instead? Well, there are a
couple of reasons why I took RTNL here:
1) The FIB notification chain is blocking, so listeners are expected to
be able to sleep. This isn't possible if we use RCU. Note that this
chain is mainly useful for drivers that reflect the FIB table into a
capable device and hardware operations usually involve sleeping.
2) The insertion of a single route is done with RTNL held. I didn't want
to differentiate between both cases. This property is really useful for
listeners, as they don't need to worry about locking in writer-side.
Access to data structs is serialized by RTNL.
Thanks for reviewing.
next prev parent reply other threads:[~2016-10-31 22:58 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-31 21:13 [PATCH net-next v2] ipv4: fib: Replay events when registering FIB notifier idosch
2016-10-31 21:24 ` Eric Dumazet
2016-10-31 22:57 ` Ido Schimmel [this message]
2016-11-01 14:19 ` Eric Dumazet
2016-11-01 15:14 ` Roopa Prabhu
2016-11-01 15:36 ` David Miller
2016-11-02 7:35 ` Jiri Pirko
2016-11-02 15:26 ` David Miller
2016-11-01 17:03 ` Ido Schimmel
2016-11-02 2:13 ` Roopa Prabhu
2016-11-02 7:20 ` Jiri Pirko
2016-11-02 13:29 ` Roopa Prabhu
2016-11-02 13:44 ` Ido Schimmel
2016-11-02 13:48 ` Jiri Pirko
2016-11-02 14:35 ` Roopa Prabhu
2016-11-02 14:43 ` Jiri Pirko
2016-11-01 15:44 ` Ido Schimmel
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=20161031225737.7nfoy4ka3ydzhptq@splinter \
--to=idosch@idosch.org \
--cc=alexander.h.duyck@intel.com \
--cc=andrew@lunn.ch \
--cc=andy@greyhouse.net \
--cc=davem@davemloft.net \
--cc=dsa@cumulusnetworks.com \
--cc=eric.dumazet@gmail.com \
--cc=f.fainelli@gmail.com \
--cc=idosch@mellanox.com \
--cc=jiri@mellanox.com \
--cc=jmorris@namei.org \
--cc=kaber@trash.net \
--cc=kuznet@ms2.inr.ac.ru \
--cc=mlxsw@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=nikolay@cumulusnetworks.com \
--cc=roopa@cumulusnetworks.com \
--cc=vivien.didelot@savoirfairelinux.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).