From patchwork Mon Jul 20 09:28:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Du, Fan" X-Patchwork-Id: 6825981 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 899049F7B4 for ; Mon, 20 Jul 2015 09:30:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C3AFB2063A for ; Mon, 20 Jul 2015 09:30:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DDFB720650 for ; Mon, 20 Jul 2015 09:30:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752667AbbGTJaO (ORCPT ); Mon, 20 Jul 2015 05:30:14 -0400 Received: from mga14.intel.com ([192.55.52.115]:22919 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751949AbbGTJaI (ORCPT ); Mon, 20 Jul 2015 05:30:08 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 20 Jul 2015 02:30:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,507,1432623600"; d="scan'208";a="750647647" Received: from dufan-optiplex-9010.bj.intel.com ([10.238.155.102]) by fmsmga001.fm.intel.com with ESMTP; 20 Jul 2015 02:30:08 -0700 From: Fan Du To: kvm@vger.kernel.org Cc: penberg@kernel.org, Fan Du Subject: [PATCH 3/3] kvm-tool: Restrict queue number to 1 when vhost on Date: Mon, 20 Jul 2015 17:28:47 +0800 Message-Id: <1437384527-22987-4-git-send-email-fan.du@intel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1437384527-22987-1-git-send-email-fan.du@intel.com> References: <1437384527-22987-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 --- tools/kvm/virtio/net.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/kvm/virtio/net.c b/tools/kvm/virtio/net.c index 5678ff2..32159f1 100644 --- a/tools/kvm/virtio/net.c +++ b/tools/kvm/virtio/net.c @@ -714,6 +714,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("Virtio vhost does not support mq yet, overide mq to 1."); + } return 0; }