From: David Ahern <dsahern@gmail.com>
To: Stefano Brivio <sbrivio@redhat.com>, David Miller <davem@davemloft.net>
Cc: Jianlin Shi <jishi@redhat.com>, Wei Wang <weiwan@google.com>,
Martin KaFai Lau <kafai@fb.com>,
Eric Dumazet <edumazet@google.com>,
Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>,
netdev@vger.kernel.org
Subject: Re: [PATCH net-next v7 04/11] ipv4: Dump route exceptions if requested
Date: Fri, 21 Jun 2019 16:19:21 -0600 [thread overview]
Message-ID: <542d653a-37c8-66b3-df34-71a0e0273f8b@gmail.com> (raw)
In-Reply-To: <8d3b68cd37fb5fddc470904cdd6793fcf480c6c1.1561131177.git.sbrivio@redhat.com>
On 6/21/19 9:45 AM, Stefano Brivio wrote:
> Since commit 4895c771c7f0 ("ipv4: Add FIB nexthop exceptions."), cached
> exception routes are stored as a separate entity, so they are not dumped
> on a FIB dump, even if the RTM_F_CLONED flag is passed.
>
> This implies that the command 'ip route list cache' doesn't return any
> result anymore.
>
> If the RTM_F_CLONED is passed, and strict checking requested, retrieve
> nexthop exception routes and dump them. If no strict checking is
> requested, filtering can't be performed consistently: dump everything in
> that case.
>
> With this, we need to add an argument to the netlink callback in order to
> track how many entries were already dumped for the last leaf included in
> a partial netlink dump.
>
> A single additional argument is sufficient, even if we traverse logically
> nested structures (nexthop objects, hash table buckets, bucket chains): it
> doesn't matter if we stop in the middle of any of those, because they are
> always traversed the same way. As an example, s_i values in [], s_fa
> values in ():
>
> node (fa) #1 [1]
> nexthop #1
> bucket #1 -> #0 in chain (1)
> bucket #2 -> #0 in chain (2) -> #1 in chain (3) -> #2 in chain (4)
> bucket #3 -> #0 in chain (5) -> #1 in chain (6)
>
> nexthop #2
> bucket #1 -> #0 in chain (7) -> #1 in chain (8)
> bucket #2 -> #0 in chain (9)
> --
> node (fa) #2 [2]
> nexthop #1
> bucket #1 -> #0 in chain (1) -> #1 in chain (2)
> bucket #2 -> #0 in chain (3)
>
> it doesn't matter if we stop at (3), (4), (7) for "node #1", or at (2)
> for "node #2": walking flattens all that.
>
> It would even be possible to drop the distinction between the in-tree
> (s_i) and in-node (s_fa) counter, but a further improvement might
> advise against this. This is only as accurate as the existing tracking
> mechanism for leaves: if a partial dump is restarted after exceptions
> are removed or expired, we might skip some non-dumped entries.
...
>
> Fixes: 4895c771c7f0 ("ipv4: Add FIB nexthop exceptions.")
> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
> ---
> include/net/route.h | 4 +++
> net/ipv4/fib_trie.c | 44 +++++++++++++++++++--------
> net/ipv4/route.c | 73 +++++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 108 insertions(+), 13 deletions(-)
>
Reviewed-by: David Ahern <dsahern@gmail.com>
next prev parent reply other threads:[~2019-06-21 22:19 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-21 15:45 [PATCH net-next v7 00/11] Fix listing (IPv4, IPv6) and flushing (IPv6) of cached route exceptions Stefano Brivio
2019-06-21 15:45 ` [PATCH net-next v7 01/11] fib_frontend, ip6_fib: Select routes or exceptions dump from RTM_F_CLONED Stefano Brivio
2019-06-21 15:45 ` [PATCH net-next v7 02/11] ipv4/fib_frontend: Allow RTM_F_CLONED flag to be used for filtering Stefano Brivio
2019-06-21 15:45 ` [PATCH net-next v7 03/11] ipv4/route: Allow NULL flowinfo in rt_fill_info() Stefano Brivio
2019-06-21 15:45 ` [PATCH net-next v7 04/11] ipv4: Dump route exceptions if requested Stefano Brivio
2019-06-21 22:19 ` David Ahern [this message]
2019-06-21 15:45 ` [PATCH net-next v7 05/11] Revert "net/ipv6: Bail early if user only wants cloned entries" Stefano Brivio
2019-06-21 15:45 ` [PATCH net-next v7 06/11] ipv6/route: Don't match on fc_nh_id if not set in ip6_route_del() Stefano Brivio
2019-06-21 15:45 ` [PATCH net-next v7 07/11] ipv6/route: Change return code of rt6_dump_route() for partial node dumps Stefano Brivio
2019-06-21 15:45 ` [PATCH net-next v7 08/11] ipv6: Dump route exceptions if requested Stefano Brivio
2019-06-21 22:21 ` David Ahern
2019-06-21 15:45 ` [PATCH net-next v7 09/11] ip6_fib: Don't discard nodes with valid routing information in fib6_locate_1() Stefano Brivio
2019-06-21 15:45 ` [PATCH net-next v7 10/11] selftests: pmtu: Introduce list_flush_ipv4_exception test case Stefano Brivio
2019-06-21 15:45 ` [PATCH net-next v7 11/11] selftests: pmtu: Make list_flush_ipv6_exception test more demanding Stefano Brivio
2019-06-24 17:20 ` [PATCH net-next v7 00/11] Fix listing (IPv4, IPv6) and flushing (IPv6) of cached route exceptions David Miller
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=542d653a-37c8-66b3-df34-71a0e0273f8b@gmail.com \
--to=dsahern@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jishi@redhat.com \
--cc=kafai@fb.com \
--cc=matti.vaittinen@fi.rohmeurope.com \
--cc=netdev@vger.kernel.org \
--cc=sbrivio@redhat.com \
--cc=weiwan@google.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;
as well as URLs for NNTP newsgroup(s).