From: Johannes Berg <johannes@sipsolutions.net>
To: David Ahern <dsahern@gmail.com>, Jan Moskyto Matejka <mq@jmq.cz>
Cc: David Miller <davem@davemloft.net>,
mq@ucw.cz, netdev@vger.kernel.org,
roopa <roopa@cumulusnetworks.com>
Subject: Re: [PATCH] net: ipv6: Truncate single route when it doesn't fit into dump buffer.
Date: Mon, 15 May 2017 00:20:22 +0200 [thread overview]
Message-ID: <1494800422.2803.4.camel@sipsolutions.net> (raw)
In-Reply-To: <fefe8b7a-3264-333a-bab3-7e0dd82efed1@gmail.com> (sfid-20170515_001425_176241_115278E5)
On Sun, 2017-05-14 at 16:14 -0600, David Ahern wrote:
> On 5/14/17 3:00 PM, Johannes Berg wrote:
> > On Sat, 2017-05-13 at 19:29 +0200, Jan Moskyto Matejka wrote:
> > >
> > > > When adding a route to the skb, track whether it contains at
> > > > least
> > > > 1
> > > > route. If not, it means the next route in the dump is larger
> > > > than
> > > > the
> > > > given buffer. Detect this condition and error out of the dump -
> > > > returning an error to the user (-ENOSPC? or EMSGSIZE?)
> > >
> > > EMSGSIZE seems OK for me.
> >
> > If we return an error here, and consequently allow for userspace
> > changes to pick this up, perhaps we could also consider allowing to
> > split the dump between nexthops, so that arbitrary such things can
> > be
> > returned.
>
> Returning an error should not impact existing userspace; it should
> already be checking for an error response in the message.
Right. I was sort of thinking that you'd catch the error and try with a
bigger buffer or so.
> Splitting the dump between nexthops across multiple messages will
> have repercussions on userspace. I think (at least for rtnetlink and
> links, addresses, routes) userspace needs to provide a buffer large
> enough for a complete object. If we limit the number of nexthops to
> something reasonable (e.g., 256), then ipv4 for example will be ~ 3kB
> + lwt encap size we are talking on the order of an 8kb maybe 16kB
> buffer. That is a reasonable request for the API.
Yeah, that seems reasonable.
We had a bigger problem here, in that the # of channels supported, and
the amount of data per channel, was increasing all the time.
johannes
next prev parent reply other threads:[~2017-05-14 22:20 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-12 11:15 [PATCH] net: ipv6: Truncate single route when it doesn't fit into dump buffer Jan Moskyto Matejka
2017-05-12 15:24 ` David Miller
2017-05-12 17:26 ` David Ahern
2017-05-12 17:34 ` David Miller
2017-05-12 21:41 ` Jan Moskyto Matejka
2017-05-13 6:52 ` David Ahern
2017-05-13 10:54 ` Jan Moskyto Matejka
2017-05-13 17:13 ` David Ahern
2017-05-13 17:29 ` Jan Moskyto Matejka
2017-05-14 21:00 ` Johannes Berg
2017-05-14 22:14 ` David Ahern
2017-05-14 22:20 ` Johannes Berg [this message]
2017-05-12 21:34 ` Jan Moskyto Matejka
2017-05-12 21:43 ` Jan Moskyto Matejka
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=1494800422.2803.4.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=davem@davemloft.net \
--cc=dsahern@gmail.com \
--cc=mq@jmq.cz \
--cc=mq@ucw.cz \
--cc=netdev@vger.kernel.org \
--cc=roopa@cumulusnetworks.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).