Thread (17 messages) 17 messages, 5 authors, 2009-11-10

Re: iproute uses too small of a receive buffer

From: Patrick McHardy <hidden>
Date: 2009-10-28 19:50:50

Ben Greear wrote:
On 10/28/2009 12:05 PM, Patrick McHardy wrote:
quoted
Eric Dumazet wrote:
quoted
Stephen Hemminger a écrit :
quoted
Just having larger buffer isn't guarantee of success. Allocating
a huge buffer is not going to work on embedded.
Please note we do not allocate a big buffer, only allow more small skbs
to be queued on socket receive queue.

If memory is not available, skb allocation will eventually fail
and be reported as well, embedded or not.

I vote for allowing 1024*1024 bytes instead of 32768,
and eventually user should be warned that it is capped by
/proc/sys/net/core/rmem_max
How about this? It will double the receive queue limit on ENOBUFS
up to 1024 * 1024b, then bail out with the normal error message on
further ENOBUFS.

Signed-off-by: Patrick McHardy<redacted>
First:  This still pretty much guarantees that messages will be lost when
the program starts (when messages are coming in too large of chunks for
small buffers)
If you are debugging something tricky, having lost messages will be
very annoying!
Yeah, on second thought the probing also doesn't make too much sense
since the memory is only used when its really needed anyways. And its
capped by rmem_max.
Second:  Why bail on ENOBUFS at all?  I don't see how it helps the user
since they will probably just have to start it again, and will miss more
messages than keeping going would have.
Agreed.
And, even 1MB may not be enough for some scenarios.  So, probably best to
let users over-ride the initial setting on cmd-line.  If not, then use
a large value to start with.
How about this? It uses 1MB as receive buf limit by default (without
increasing /proc/sys/net/core/rmem_max it will be limited by less
however) and allows to specify the size manually using "-rcvbuf X"
(-r is already used, so you need to specify at least -rc).

Additionally rtnl_listen() continues on ENOBUFS after printing the
error message.

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help