From patchwork Mon Aug 21 01:50:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ZhiPeng Lu X-Patchwork-Id: 9911573 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 C8582602A0 for ; Mon, 21 Aug 2017 01:52:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B97942862D for ; Mon, 21 Aug 2017 01:52:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ACD7B286E0; Mon, 21 Aug 2017 01:52:43 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 B1B0B2862D for ; Mon, 21 Aug 2017 01:52:42 +0000 (UTC) Received: from localhost ([::1]:55042 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1djbtO-0000jd-Vy for patchwork-qemu-devel@patchwork.kernel.org; Sun, 20 Aug 2017 21:52:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39386) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1djbsf-0000hg-Nh for qemu-devel@nongnu.org; Sun, 20 Aug 2017 21:51:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1djbsc-0004wq-Mp for qemu-devel@nongnu.org; Sun, 20 Aug 2017 21:51:53 -0400 Received: from mxhk.zte.com.cn ([63.217.80.70]:28132 helo=zte.com.cn) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1djbsc-0004w8-Cg for qemu-devel@nongnu.org; Sun, 20 Aug 2017 21:51:50 -0400 X-scanvirus: By SEG_CYREN AntiVirus Engine X-scanresult: CLEAN X-MAILFROM: X-RCPTTO: X-FROMIP: 10.30.3.20 X-SEG-Scaned: 1 X-Received: unknown,10.30.3.20,20170821095127 Received: from unknown (HELO mse01.zte.com.cn) (10.30.3.20) by localhost with (AES256-SHA encrypted) SMTP; 21 Aug 2017 01:51:27 -0000 Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id v7L1pTnj032942; Mon, 21 Aug 2017 09:51:29 +0800 (GMT-8) (envelope-from lu.zhipeng@zte.com.cn) Received: from ceshi.localdomain ([10.74.120.130]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2017082109513064-351093 ; Mon, 21 Aug 2017 09:51:30 +0800 From: ZhiPeng Lu To: mst@redhat.com Date: Mon, 21 Aug 2017 09:50:23 +0800 Message-Id: <1503280223-6880-1-git-send-email-lu.zhipeng@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2017-08-21 09:51:30, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2017-08-21 09:51:29, Serialize complete at 2017-08-21 09:51:29 X-MAIL: mse01.zte.com.cn v7L1pTnj032942 X-HQIP: 127.0.0.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 63.217.80.70 Subject: [Qemu-devel] [PATCH] vhost: don't set vring call fd to -1 in vhost_virtqueue_start for vhost-user 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: ZhiPeng Lu , jasowang@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP commit 96a3d98d2cdbd897ff5ab33427aa4cfb94077665 (vhost: don't set vring call if no vector) set vring call fd to -1 for drivers does not use interrupt at all(e.g virtio-net pmd). That patch setting vring call fd to -1 cause the network to not work when running dpdk in the guest. The openvswitch port status is down by executing the command "ovs-vsctl list interface" in host of running the guest. The network is ok if it doesn't set vring call fd to -1 in vhost_virtqueue_start. The patch doesn't set vring call fd to -1 for vhost-user. Signed-off-by: ZhiPeng Lu --- hw/virtio/vhost.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index 6eddb09..bb8db7d 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -1098,7 +1098,8 @@ static int vhost_virtqueue_start(struct vhost_dev *dev, if (k->query_guest_notifiers && k->query_guest_notifiers(qbus->parent) && - virtio_queue_vector(vdev, idx) == VIRTIO_NO_VECTOR) { + virtio_queue_vector(vdev, idx) == VIRTIO_NO_VECTOR && + vdev->use_guest_notifier_mask) { file.fd = -1; r = dev->vhost_ops->vhost_set_vring_call(dev, &file); if (r) {