From patchwork Mon Oct 11 13:47:38 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Meneghel Rodrigues X-Patchwork-Id: 245461 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9BDlnsO005972 for ; Mon, 11 Oct 2010 13:47:50 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754464Ab0JKNrq (ORCPT ); Mon, 11 Oct 2010 09:47:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38116 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754211Ab0JKNrq (ORCPT ); Mon, 11 Oct 2010 09:47:46 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o9BDlhd9003822 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 11 Oct 2010 09:47:43 -0400 Received: from freedom.redhat.com (vpn-9-237.rdu.redhat.com [10.11.9.237]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id o9BDleHg009087; Mon, 11 Oct 2010 09:47:41 -0400 From: Lucas Meneghel Rodrigues To: autotest@test.kernel.org Cc: kvm@vger.kernel.org, jasowang@redhat.com, mst@redhat.com, Lucas Meneghel Rodrigues Subject: [PATCH] KVM test: Add vhost-net support Date: Mon, 11 Oct 2010 10:47:38 -0300 Message-Id: <1286804858-11280-1-git-send-email-lmr@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Mon, 11 Oct 2010 13:47:50 +0000 (UTC) diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py index 3388b14..848ff63 100755 --- a/client/tests/kvm/kvm_vm.py +++ b/client/tests/kvm/kvm_vm.py @@ -282,9 +282,11 @@ class VM: def add_net(help, vlan, mode, ifname=None, script=None, downscript=None, tftp=None, bootfile=None, hostfwd=[], - netdev_id=None): + netdev_id=None, vhost=False): if has_option(help, "netdev"): cmd = " -netdev %s,id=%s" % (mode, netdev_id) + if vhost: + cmd +=",vhost=on" else: cmd = " -net %s,vlan=%d" % (mode, vlan) if mode == "tap": @@ -448,7 +450,8 @@ class VM: self.get_ifname(vlan), script, downscript, tftp, nic_params.get("bootp"), redirs, - self.netdev_id[vlan]) + self.netdev_id[vlan], + nic_params.get("vhost")=="yes") # Proceed to next NIC vlan += 1 diff --git a/client/tests/kvm/tests_base.cfg.sample b/client/tests/kvm/tests_base.cfg.sample index 8d62c42..769d750 100644 --- a/client/tests/kvm/tests_base.cfg.sample +++ b/client/tests/kvm/tests_base.cfg.sample @@ -699,9 +699,11 @@ variants: supported_features = "tx rx sg tso gso gro lro" - virtio_net: nic_model = virtio - # you can add advanced attributes on nic_extra_params - # such as mrg_rxbuf + # You can add advanced attributes on nic_extra_params such as mrg_rxbuf #nic_extra_params = + # You can set vhost = yes to enable the vhost kernel backend + # (This only works if nic_mode=tap) + vhost = no jumbo: mtu = 65520 ethtool: