All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Adam Urban <adam.urban@appleguru.org>,
	Eric Dumazet <eric.dumazet@gmail.com>
Cc: Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
	Network Development <netdev@vger.kernel.org>
Subject: Re: Kernel UDP behavior with missing destinations
Date: Thu, 16 May 2019 10:03:16 -0700	[thread overview]
Message-ID: <1f6a6c3f-d723-4739-da77-58a55cfa2170@gmail.com> (raw)
In-Reply-To: <CABUuw67crf5yb0G_KRR94WLBP8YYLgABBgv1SFW0SvKB_ntK4w@mail.gmail.com>



On 5/16/19 9:32 AM, Adam Urban wrote:
> Eric, thanks. Increasing wmem_default from 229376 to 2293760 indeed
> makes the issue go away on my test bench. What's a good way to
> determine the optimal value here? I assume this is in bytes and needs
> to be large enough so that the SO_SNDBUF doesn't fill up before the
> kernel drops the packets. How often does that happen?

You have to count the max number of arp queues your UDP socket could hit.

Say this number is X

Then wmem_default should be set  to X * unres_qlen_bytes + Y

With Y =  229376  (the default  wmem_default)

Then, you might need to increase the qdisc limits.

If no arp queue is active, all UDP packets could be in the qdisc and might hit sooner
the qdisc limit, thus dropping packets on the qdisc.

(This is assuming your UDP application can blast packets at a rate above the link rate)

> 
> On Thu, May 16, 2019 at 12:14 PM Eric Dumazet <eric.dumazet@gmail.com> wrote:
>>
>>
>>
>> On 5/16/19 9:05 AM, Eric Dumazet wrote:
>>
>>> We probably should add a ttl on arp queues.
>>>
>>> neigh_probe() could do that quite easily.
>>>
>>
>> Adam, all you need to do is to increase UDP socket sndbuf.
>>
>> Either by increasing /proc/sys/net/core/wmem_default
>>
>> or using setsockopt( ... SO_SNDBUF ... )
>>

  reply	other threads:[~2019-05-16 17:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-15 19:56 Kernel UDP behavior with missing destinations Adam Urban
2019-05-16 14:47 ` Willem de Bruijn
2019-05-16 15:43   ` Adam Urban
2019-05-16 16:05   ` Eric Dumazet
2019-05-16 16:14     ` Eric Dumazet
2019-05-16 16:32       ` Adam Urban
2019-05-16 17:03         ` Eric Dumazet [this message]
2019-05-16 21:42           ` Adam Urban
2019-05-17  0:27     ` Adam Urban
2019-05-17  3:22       ` Willem de Bruijn
2019-05-17 12:57         ` David Laight
2019-05-17 13:20           ` Willem de Bruijn

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=1f6a6c3f-d723-4739-da77-58a55cfa2170@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=adam.urban@appleguru.org \
    --cc=netdev@vger.kernel.org \
    --cc=willemdebruijn.kernel@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.