From patchwork Wed Nov 9 15:22:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuri Benditovich X-Patchwork-Id: 9419685 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6BA0B60512 for ; Wed, 9 Nov 2016 15:40:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5DD9C2880A for ; Wed, 9 Nov 2016 15:40:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 511232933F; Wed, 9 Nov 2016 15:40:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CAF192880A for ; Wed, 9 Nov 2016 15:40:53 +0000 (UTC) Received: from localhost ([::1]:40712 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c4Uzc-0004ja-Sk for patchwork-qemu-devel@patchwork.kernel.org; Wed, 09 Nov 2016 10:40:52 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49496) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c4Uhq-0004mk-Cf 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 1c4Uho-0006Mj-Dd for qemu-devel@nongnu.org; Wed, 09 Nov 2016 10:22:30 -0500 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:34586) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c4Uho-0006L0-6f for qemu-devel@nongnu.org; Wed, 09 Nov 2016 10:22:28 -0500 Received: by mail-wm0-x244.google.com with SMTP id p190so29963763wmp.1 for ; Wed, 09 Nov 2016 07:22:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=NBhLhqGSHLRgJo4u7rWEo/wr2E74TpAKTS/tktta0Uc=; b=P1r38o7MWNcOZj1NmuZM/t9MjezM84g84fgbwbt4qd2EF/Rn89ZbDw0RONX80WP6i4 vlylePIX8eJHY62PRLhUfkt6nKrQSqG1IlpyTTLLKpymN0lYaMxLiM3cbZw30mtXjBrG pp4spj01J12Eg52rNWnx1BVUtzL2OmQ0OzXgvs41ASBOogS3f5ssyLtCBfwpJhwWZKqN NC23vun80fApUs/uA9yw7khojZRlg7hpVxp9PL4+cVo72QQ39zTielCSEe3asZSxskr1 BaWFWE9MCEL31YwfY5uSuZ+SoPfWDx7Wx+QrMDPgnDIJANXGSLUwBbJGVN6VCA3h3IWB uqCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=NBhLhqGSHLRgJo4u7rWEo/wr2E74TpAKTS/tktta0Uc=; b=HDS0C25vYZIj1kNk+t/7KVFMzrj0A7TMfuT/9Tlogohw1/eYLQ2qVWkbq3Q64lbuB7 SAhhvcFDGSLTKQLNSDRfJ7eG5iafjwUt5UOHfjBFY2lCfghtF5gUVlamw+G+CyyowZFK NVZ/uKEHmWAKywtb7YkrtGWbmLts7z7eBnnSdvK0YmIB+mRDaPqzSYj9jQjWutd5XeNa Ujo15IQWw0RorY5vLMu53gJZ7LyKzr+jP9W0iX0axO0iQssJDvFJfiU4Krl7t/HD0/jk d+v7PPAb+KWNLXx8zyw7KkBiu1M9XXRnV+/jJNf2eBoXledCSWewJgW4Cv+g4nTxZszb 3JTA== X-Gm-Message-State: ABUngvdnl2k9BHVz+CD7O6/E7WlW2HOtCKehXCrW/AeLh1EG6fab3vsdH3ip4iywa6d1cw== X-Received: by 10.28.13.9 with SMTP id 9mr818686wmn.50.1478704947020; Wed, 09 Nov 2016 07:22:27 -0800 (PST) Received: from localhost.localdomain ([141.226.163.133]) by smtp.gmail.com with ESMTPSA id q125sm822641wmd.2.2016.11.09.07.22.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 09 Nov 2016 07:22:26 -0800 (PST) From: yuri.benditovich@daynix.com To: "Michael S . Tsirkin" , Jason Wang , qemu-devel@nongnu.org Date: Wed, 9 Nov 2016 17:22:01 +0200 Message-Id: <1478704922-3400-3-git-send-email-yuri.benditovich@daynix.com> X-Mailer: git-send-email 2.7.0.windows.1 In-Reply-To: <1478704922-3400-1-git-send-email-yuri.benditovich@daynix.com> References: <1478704922-3400-1-git-send-email-yuri.benditovich@daynix.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PATCH v2 2/3] net: vhost stop updates virtio queue state X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dmitry@daynix.com, yan@daynix.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Yuri Benditovich Make virtio queue suitable for push operation from qemu after vhost was stopped. Signed-off-by: Yuri Benditovich --- hw/virtio/vhost.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index bd051ab..2e990d0 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -963,6 +963,7 @@ static void vhost_virtqueue_stop(struct vhost_dev *dev, virtio_queue_set_last_avail_idx(vdev, idx, state.num); } virtio_queue_invalidate_signalled_used(vdev, idx); + virtio_queue_update_used_idx(vdev, idx); /* In the cross-endian case, we need to reset the vring endianness to * native as legacy devices expect so by default.