From: Edward Cree <ecree@solarflare.com>
To: Shawn Bohrer <shawn.bohrer@gmail.com>
Cc: <netdev@vger.kernel.org>, Shawn Bohrer <sbohrer@rgmadvisors.com>,
Jonathan Cooper <jcooper@solarflare.com>,
<eric.dumazet@gmail.com>
Subject: Re: udp: Question about busy_poll change
Date: Wed, 9 Apr 2014 17:20:04 +0100 [thread overview]
Message-ID: <53457334.1030602@solarflare.com> (raw)
In-Reply-To: <20140409145129.GA4002@sbohrermbp13-local.rgmadvisors.com>
On 09/04/14 15:51, Shawn Bohrer wrote:
> I believe the sfc case where you only have a single NAPI context is
> also valid and it seems reasonable to me that if you can detect that
> specific case that busy polling could be allowed. I'm not sure how to
> detect this. I'm sure patches are welcome.
I think that to detect this we would have to have (a) a flag in the
struct sock to say that "this socket is bound to a real address" (ie.
not INADDR_ANY, multicast or anycast), (b) a flag in the skb to say that
"the driver that received this packet only uses one NAPI context per
intf. Then if a && b you can fill in sk_napi_id even on unconnected
sockets. If this sounds reasonable, I'll put a patch together.
> If we are spinning on a NAPI context and a packet arrives in a
> different rx queue then you'll get unpredictable latencies and
> out of order packets. For the people using this feature that is
> probably not desirable.
A further question is, what happens if the user removes the IP address
from one interface and adds it to another? AFAICT they will keep
busy_polling the old NAPI context until a packet is received on the new
interface and updates sk->sk_napi_id; and this is still the case even if
the socket is connected. Of course this could be a case of "don't do
that then", but I can imagine some kind of hot-failover setup doing this.
This is also why we'd need a flag in the skb and can't just find out at
bind() time what the driver is and whether it uses multiple NAPI
contexts - because when the socket moves interface, it could end up on a
different driver.
next prev parent reply other threads:[~2014-04-09 16:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-09 14:13 udp: Question about busy_poll change Edward Cree
2014-04-09 14:51 ` Shawn Bohrer
2014-04-09 16:20 ` Edward Cree [this message]
2014-04-10 18:04 ` [RFC PATCH] udp: allow busy_poll on some unconnected sockets Edward Cree
2014-04-10 18:32 ` Eric Dumazet
2014-04-10 18:38 ` Edward Cree
2014-04-10 19:04 ` Eric Dumazet
2014-04-11 10:44 ` Jonathan Cooper
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=53457334.1030602@solarflare.com \
--to=ecree@solarflare.com \
--cc=eric.dumazet@gmail.com \
--cc=jcooper@solarflare.com \
--cc=netdev@vger.kernel.org \
--cc=sbohrer@rgmadvisors.com \
--cc=shawn.bohrer@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 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).