qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: armbru@redhat.com, alex.williamson@redhat.com,
	glommer@redhat.com, lcapitulino@redhat.com, jasowang@redhat.com,
	Amit Shah <amit.shah@redhat.com>,
	qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCHv3 2/2] vhost: disable on tap link down
Date: Wed, 9 Feb 2011 18:45:09 +0200	[thread overview]
Message-ID: <0b4378b01430b620069407a3ffd8dce6ecbbe343.1297269881.git.mst@redhat.com> (raw)
In-Reply-To: <cover.1297269881.git.mst@redhat.com>

qemu makes it possible to disable link at tap
which is not communicated to the guest but
causes all packets to be dropped.

When vhost-net is enabled, vhost needs to be aware of both the virtio
link_down and the peer link_down. we switch to userspace emulation when
either is down.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reported-by: pradeep <psuriset@linux.vnet.ibm.com>
---
 hw/virtio-net.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/hw/virtio-net.c b/hw/virtio-net.c
index 671d952..20cf680 100644
--- a/hw/virtio-net.c
+++ b/hw/virtio-net.c
@@ -115,7 +115,8 @@ static void virtio_net_vhost_status(VirtIONet *n, uint8_t status)
     if (!tap_get_vhost_net(n->nic->nc.peer)) {
         return;
     }
-    if (!!n->vhost_started == virtio_net_started(n, status)) {
+    if (!!n->vhost_started == virtio_net_started(n, status) &&
+                              !n->nic->nc.peer->link_down) {
         return;
     }
     if (!n->vhost_started) {
-- 
1.7.3.2.91.g446ac

  parent reply	other threads:[~2011-02-09 16:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-09 16:44 [Qemu-devel] [PATCHv3 0/2] vhost: fix tap link down Michael S. Tsirkin
2011-02-09 16:45 ` [Qemu-devel] [PATCHv3 1/2] net: notify peer about link status change Michael S. Tsirkin
2011-02-09 16:45 ` Michael S. Tsirkin [this message]
2011-02-09 17:09 ` [Qemu-devel] Re: [PATCHv3 0/2] vhost: fix tap link down Alex Williamson
2011-02-10  5:33 ` [Qemu-devel] " Jason Wang
2011-02-20 17:07 ` Aurelien Jarno

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=0b4378b01430b620069407a3ffd8dce6ecbbe343.1297269881.git.mst@redhat.com \
    --to=mst@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=amit.shah@redhat.com \
    --cc=armbru@redhat.com \
    --cc=glommer@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=qemu-devel@nongnu.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).