netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefano Brivio <sbrivio@redhat.com>
To: Martin Lau <kafai@fb.com>
Cc: David Miller <davem@davemloft.net>,
	Jianlin Shi <jishi@redhat.com>, "Wei Wang" <weiwan@google.com>,
	David Ahern <dsahern@gmail.com>,
	Eric Dumazet <edumazet@google.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH net 1/2] ipv6: Dump route exceptions too in rt6_dump_route()
Date: Fri, 7 Jun 2019 00:17:47 +0200	[thread overview]
Message-ID: <20190607001747.4ced02c7@redhat.com> (raw)
In-Reply-To: <20190606214456.orxy6274xryxyfww@kafai-mbp.dhcp.thefacebook.com>

On Thu, 6 Jun 2019 21:44:58 +0000
Martin Lau <kafai@fb.com> wrote:

> > +	if (!(filter->flags & RTM_F_CLONED)) {
> > +		err = rt6_fill_node(net, arg->skb, rt, NULL, NULL, NULL, 0,
> > +				    RTM_NEWROUTE,
> > +				    NETLINK_CB(arg->cb->skb).portid,
> > +				    arg->cb->nlh->nlmsg_seq, flags);
> > +		if (err)
> > +			return err;
> > +	} else {
> > +		flags |= NLM_F_DUMP_FILTERED;
> > +	}
> > +
> > +	bucket = rcu_dereference(rt->rt6i_exception_bucket);
> > +	if (!bucket)
> > +		return 0;
> > +
> > +	for (i = 0; i < FIB6_EXCEPTION_BUCKET_SIZE; i++) {
> > +		hlist_for_each_entry(rt6_ex, &bucket->chain, hlist) {
> > +			if (rt6_check_expired(rt6_ex->rt6i))
> > +				continue;
> > +
> > +			err = rt6_fill_node(net, arg->skb, rt,
> > +					    &rt6_ex->rt6i->dst,
> > +					    NULL, NULL, 0, RTM_NEWROUTE,
> > +					    NETLINK_CB(arg->cb->skb).portid,
> > +					    arg->cb->nlh->nlmsg_seq, flags);  
> Thanks for the patch.
> 
> A question on when rt6_fill_node() returns -EMSGSIZE while dumping the
> exception bucket here.  Where will the next inet6_dump_fib() start?

And thanks for reviewing.

It starts again from the same node, see fib6_dump_node(): w->leaf = rt;
where rt is the fib6_info where we failed dumping, so we won't skip
dumping any node.

This also means that to avoid sending duplicates in the case where at
least one rt6_fill_node() call goes through and one fails, we would
need to track the last bucket and entry sent, or, alternatively, to
make sure we can fit the whole node before dumping.

I don't think that can happen in practice, or at least I haven't found a
way to create enough valid exceptions for the same node.

Anyway, I guess that would be nicer, but the fix is going to be much
bigger, and I don't think we even have to guarantee that. I'd rather
take care of that as a follow-up. Any preferred solution by the way?

-- 
Stefano

  reply	other threads:[~2019-06-06 22:17 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-06 20:13 [PATCH net 0/2] ipv6: Fix listing and flushing of cached route exceptions Stefano Brivio
2019-06-06 20:13 ` [PATCH net 1/2] ipv6: Dump route exceptions too in rt6_dump_route() Stefano Brivio
2019-06-06 20:57   ` David Ahern
2019-06-06 21:18     ` Stefano Brivio
2019-06-06 22:47       ` David Ahern
2019-06-06 23:07         ` Stefano Brivio
2019-06-08  5:40         ` Martin Lau
2019-06-08  5:59           ` Stefano Brivio
2019-06-08  7:19             ` Martin Lau
2019-06-08 15:02               ` Stefano Brivio
2019-06-08 15:47                 ` Stefano Brivio
2019-06-10 19:42                   ` Martin Lau
2019-06-10 21:01                     ` Stefano Brivio
2019-06-10  5:56                 ` Vaittinen, Matti
2019-06-10 19:01                   ` Stefano Brivio
2019-06-06 21:44   ` Martin Lau
2019-06-06 22:17     ` Stefano Brivio [this message]
2019-06-06 22:37       ` Martin Lau
2019-06-06 22:48         ` David Ahern
2019-06-07  1:54           ` Stefano Brivio
2019-06-06 22:58         ` Stefano Brivio
2019-06-06 23:15           ` Stefano Brivio
2019-06-06 23:19           ` David Ahern
2019-06-06 23:31           ` Martin Lau
2019-06-06 20:13 ` [PATCH net 2/2] ip6_fib: Don't discard nodes with valid routing information in fib6_locate_1() Stefano Brivio

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=20190607001747.4ced02c7@redhat.com \
    --to=sbrivio@redhat.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=edumazet@google.com \
    --cc=jishi@redhat.com \
    --cc=kafai@fb.com \
    --cc=netdev@vger.kernel.org \
    --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).