From patchwork Tue Jul 21 03:05:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Du, Fan" X-Patchwork-Id: 6832031 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 A39CAC05AC for ; Tue, 21 Jul 2015 03:07:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E01BF204E4 for ; Tue, 21 Jul 2015 03:07:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DC190204E3 for ; Tue, 21 Jul 2015 03:07:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754091AbbGUDG6 (ORCPT ); Mon, 20 Jul 2015 23:06:58 -0400 Received: from mga09.intel.com ([134.134.136.24]:4868 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753031AbbGUDG5 (ORCPT ); Mon, 20 Jul 2015 23:06:57 -0400 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP; 20 Jul 2015 20:06:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,512,1432623600"; d="scan'208";a="609780206" Received: from dufan-optiplex-9010.bj.intel.com ([10.238.155.102]) by orsmga003.jf.intel.com with ESMTP; 20 Jul 2015 20:06:41 -0700 From: Fan Du To: kvm@vger.kernel.org Cc: will.deacon@arm.com, marc.zyngier@arm.com, andre.przywara@arm.com, Fan Du Subject: [PATCH 2/2] kvmtool: Restrict virtio queue number to 1 when vhost on Date: Tue, 21 Jul 2015 11:05:28 +0800 Message-Id: <1437447928-24286-3-git-send-email-fan.du@intel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1437447928-24286-1-git-send-email-fan.du@intel.com> References: <1437447928-24286-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 55dd9d9..78199b9 100644 --- a/virtio/net.c +++ b/virtio/net.c @@ -731,6 +731,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; }