From: Rusty Russell <rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org>
To: Christian Borntraeger
<borntraeger-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>
Cc: kvm-devel
<kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
virtualization-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Subject: Re: [PATCH resent] virtio_net: Fix stalled inbound trafficon early packets
Date: Tue, 18 Dec 2007 17:54:15 +1100 [thread overview]
Message-ID: <200712181754.16632.rusty@rustcorp.com.au> (raw)
In-Reply-To: <200712131930.31602.borntraeger-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>
On Friday 14 December 2007 05:30:31 Christian Borntraeger wrote:
> Rusty, if you decide to apply my patch, there is one downside: The
> debugging code in virtio_ring sometimes triggers with a false positive:
>
> try_fill_recv calls vring_kick. Here we do a notify to the host. This might
> cause an immediate interrupt, triggering the poll routine before vring_kick
> can run END_USE. This is no real problem, as we dont touch the vq after
> notify.
Hmm, how about we just do something like this? (needs previous enable_cb
patch)
> Christian, facing 64 guest cpus unconvering all kind of races
Heroic is the word which comes to mind... :)
Cheers,
Rusty.
---
virtio: flush buffers on open
Fix bug found by Christian Borntraeger: if the other side fills all
the registered network buffers before we enable NAPI, we will never
get an interrupt. The simplest fix is to process the input queue once
on open.
Signed-off-by: Rusty Russell <rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org>
diff -r 1dd61213039c drivers/net/virtio_net.c
--- a/drivers/net/virtio_net.c Tue Dec 18 17:34:18 2007 +1100
+++ b/drivers/net/virtio_net.c Tue Dec 18 17:47:39 2007 +1100
@@ -326,6 +326,13 @@ static int virtnet_open(struct net_devic
return -ENOMEM;
napi_enable(&vi->napi);
+
+ /* If all buffers were filled by other side before we napi_enabled, we
+ * won't get another interrupt, so process any outstanding packets
+ * now. virtnet_poll wants re-enable the queue, so we disable here. */
+ vi->rvq->vq_ops->disable_cb(vi->rvq);
+ netif_rx_schedule(vi->dev, &vi->napi);
+
return 0;
}
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
next prev parent reply other threads:[~2007-12-18 6:54 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-11 11:42 [PATCH resent] virtio_net: Fix stalled inbound traffic on early packets Christian Borntraeger
[not found] ` <200712111242.28843.borntraeger-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>
2007-12-11 12:48 ` [PATCH resent] virtio_net: Fix stalled inbound trafficon " Dor Laor
[not found] ` <475E8716.2010500-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-12-11 12:57 ` Dor Laor
[not found] ` <475E892D.9060400-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-12-11 13:16 ` Christian Borntraeger
2007-12-12 1:54 ` [kvm-devel] " Rusty Russell
2007-12-12 11:39 ` Christian Borntraeger
2007-12-12 15:48 ` Dor Laor
[not found] ` <476002E7.5050301-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-12-12 18:14 ` Christian Borntraeger
[not found] ` <200712121914.38135.borntraeger-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>
2007-12-13 13:24 ` Dor Laor
2007-12-13 18:30 ` [kvm-devel] " Christian Borntraeger
[not found] ` <200712131930.31602.borntraeger-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>
2007-12-18 6:54 ` Rusty Russell [this message]
2007-12-11 13:19 ` Christian Borntraeger
2007-12-11 15:27 ` Christian Borntraeger
[not found] ` <200712111627.21364.borntraeger-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>
2007-12-11 23:34 ` Dor Laor
2007-12-12 11:27 ` [kvm-devel] " Christian Borntraeger
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=200712181754.16632.rusty@rustcorp.com.au \
--to=rusty-8n+1lvoiyb80n/f98k4iww@public.gmane.org \
--cc=borntraeger-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org \
--cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=virtualization-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
/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).