From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57829) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YRGaV-0004bM-Ph for qemu-devel@nongnu.org; Fri, 27 Feb 2015 03:48:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YRGaQ-0002U4-7n for qemu-devel@nongnu.org; Fri, 27 Feb 2015 03:47:59 -0500 Received: from szxga03-in.huawei.com ([119.145.14.66]:30228) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YRGaP-0002TE-Ei for qemu-devel@nongnu.org; Fri, 27 Feb 2015 03:47:54 -0500 Message-ID: <54F02F14.5040802@huawei.com> Date: Fri, 27 Feb 2015 16:47:16 +0800 From: gaohaifeng MIME-Version: 1.0 References: <47CEA9C0E570484FBF22EF0D7EBCE5B534A4984F@szxema505-mbs.china.huawei.com> <20150226093625.GA24766@redhat.com> <20150226120153.GA31740@redhat.com> In-Reply-To: <20150226120153.GA31740@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [Question] about vhost user Interface List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: "pbonzini@redhat.com" , "qemu-devel@nongnu.org" , Nikolay Nikolaev , "Lilijun (Jerry)" On 2015/2/26 20:01, Michael S. Tsirkin wrote: > On Thu, Feb 26, 2015 at 01:55:54PM +0200, Nikolay Nikolaev wrote: >> On Thu, Feb 26, 2015 at 11:36 AM, Michael S. Tsirkin wrote: >>> >>> On Thu, Feb 26, 2015 at 09:30:40AM +0000, Gaohaifeng (A) wrote: >>>> Hi >>>> >>>> I want to use pxe to install a guest os whose nic type is vhost user. However >>>> pxe rom doesn’t support msi-x interrupt, so qemu won’t start vhost net. >>>> >>>> Call relationship: >>>> >>>> virtio_net_vhost_status-> vhost_net_query-> vhost_dev_query-> >>>> virtio_pci_query_guest_notifiers -> msix_enabled >>>> >>>> >>>> >>>> In my test, I remove the msix check for vhost user interface and successfully >>>> install the guest os by pxe. >>>> >>>> Is it OK to do like this and will it cause other problems? >>>> >>>> >>>> >>>> Thanks. >>>> >>>> Haifeng Gao >>>> >>> >>> I think we should fix it. >>> As a quick hack, you should be able to just use vhostforce. >> >> >> But isn't that what vhostforce is for, runnign vhost with non >> MSI-enabled guests? >> >> regards, >> Nikolay Nikolaev > > It isn't really. > > kernel vhost is more or less an optimization. since it performs > slowly for non msi guests, it turns itself off for them by default, > and you fall back to virtio in qemu which for non msi seems to be > faster. to re-enable, set force to on. > > vhost user doesn't work with virtio in qemu, it should > ignore vhostforce and just handle non msix guests. If I understand correctly (if not,pls correct me), We can ignore vhostforce value and set it to true. So even non msix can use vhost user nic. code like this: --- vhost-user.c +++ vhost-user.c @@ -230,7 +230,6 @@ { const NetdevVhostUserOptions *vhost_user_opts; CharDriverState *chr; - bool vhostforce; assert(opts->kind == NET_CLIENT_OPTIONS_KIND_VHOST_USER); vhost_user_opts = opts->vhost_user; @@ -247,12 +247,6 @@ return -1; } - /* vhostforce for non-MSIX */ - if (vhost_user_opts->has_vhostforce) { - vhostforce = vhost_user_opts->vhostforce; - } else { - vhostforce = false; - } - return net_vhost_user_init(peer, "vhost_user", name, chr, vhostforce); + return net_vhost_user_init(peer, "vhost_user", name, chr, true); } > > > >>> >>> >>> -- >>> MST >>> > > . >