From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49499) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c4Uhq-0004mq-DR for qemu-devel@nongnu.org; Wed, 09 Nov 2016 10:22:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c4Uhm-0006Ic-B9 for qemu-devel@nongnu.org; Wed, 09 Nov 2016 10:22:30 -0500 Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]:37308) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c4Uhm-0006Fy-3T for qemu-devel@nongnu.org; Wed, 09 Nov 2016 10:22:26 -0500 Received: by mail-wm0-x232.google.com with SMTP id t79so307072215wmt.0 for ; Wed, 09 Nov 2016 07:22:25 -0800 (PST) From: yuri.benditovich@daynix.com Date: Wed, 9 Nov 2016 17:21:59 +0200 Message-Id: <1478704922-3400-1-git-send-email-yuri.benditovich@daynix.com> Subject: [Qemu-devel] [PATCH v2 0/3] virtio-net discards TX data after link down List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S . Tsirkin" , Jason Wang , qemu-devel@nongnu.org Cc: dmitry@daynix.com, yan@daynix.com From: Yuri Benditovich https://bugzilla.redhat.com/show_bug.cgi?id=1295637 Upon set_link monitor command or upon netdev deletion virtio-net sends link down indication to the guest and stops vhost if one is used. Guest driver can still submit data for TX until it recognizes link loss. If these packets not returned by the host, the Windows guest will never be able to finish disable/removal/shutdown. In order to allow qemu to discard these packets, virtio queue shall update its internal structure upon vhost stop. Changes from v1: - added drop for outstanding tx packets for tx=timer - (mainly for case of vhost=off) fixed link down flow to drop outstanding packets and ensure tx queue notification enabled Yuri Benditovich (3): net: Add virtio queue interface to update used index from vring state net: vhost stop updates virtio queue state net: virtio-net discards TX data after link down hw/net/virtio-net.c | 28 ++++++++++++++++++++++++++++ hw/virtio/vhost.c | 1 + hw/virtio/virtio.c | 5 +++++ include/hw/virtio/virtio.h | 1 + 4 files changed, 35 insertions(+) -- 1.9.1