From patchwork Tue Jul 21 06:18:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Du, Fan" X-Patchwork-Id: 6832231 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 97749C05AD for ; Tue, 21 Jul 2015 06:19:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CF93E205F0 for ; Tue, 21 Jul 2015 06:19:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E7F65205EC for ; Tue, 21 Jul 2015 06:19:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752483AbbGUGTV (ORCPT ); Tue, 21 Jul 2015 02:19:21 -0400 Received: from mga14.intel.com ([192.55.52.115]:19674 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752438AbbGUGTU (ORCPT ); Tue, 21 Jul 2015 02:19:20 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP; 20 Jul 2015 23:19:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,513,1432623600"; d="scan'208";a="732556785" Received: from dufan-optiplex-9010.bj.intel.com ([10.238.155.102]) by orsmga001.jf.intel.com with ESMTP; 20 Jul 2015 23:19:19 -0700 From: Fan Du To: kvm@vger.kernel.org Cc: will.deacon@arm.com, andre.przywara@arm.com, marc.zyngier@arm.com, Fan Du Subject: [PATCHv3 2/2] kvmtool: Restrict virtio queue number to 1 when vhost on Date: Tue, 21 Jul 2015 14:18:03 +0800 Message-Id: <1437459483-24535-3-git-send-email-fan.du@intel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1437459483-24535-1-git-send-email-fan.du@intel.com> References: <1437459483-24535-1-git-send-email-fan.du@intel.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP vhost kernel driver does not support mutiple queue yet, Tweak queue number will fail with "--net mode=tap,vhost=1,mq=2" as below when lkvm trying to set ring kick fd for queue 2: VHOST_SET_VRING_KICK failed: No buffer space available Error on this scenario, and overide with the default one queue configuration. Signed-off-by: Fan Du --- virtio/net.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/virtio/net.c b/virtio/net.c index d343615..21a80f3 100644 --- a/virtio/net.c +++ b/virtio/net.c @@ -730,6 +730,10 @@ static int set_net_param(struct kvm *kvm, struct virtio_net_params *p, p->mq = atoi(val); } else die("Unknown network parameter %s", param); + if (p->vhost && p->mq > 1) { + p->mq = 1; + pr_err("vhost does not support mq yet, overide mq to 1."); + } return 0; }