From patchwork Thu Feb 7 09:46:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 218872 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 52DD52C0293 for ; Thu, 7 Feb 2013 20:42:38 +1100 (EST) Received: from localhost ([::1]:51807 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3O04-0007tB-JZ for incoming@patchwork.ozlabs.org; Thu, 07 Feb 2013 04:42:36 -0500 Received: from eggs.gnu.org ([208.118.235.92]:57904) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3Nzv-0007sn-Px for qemu-devel@nongnu.org; Thu, 07 Feb 2013 04:42:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U3Nzt-0000v6-Dg for qemu-devel@nongnu.org; Thu, 07 Feb 2013 04:42:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:17536) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3Nzt-0000v2-6a for qemu-devel@nongnu.org; Thu, 07 Feb 2013 04:42:25 -0500 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.14.4/8.14.4) with ESMTP id r179gOXQ021941 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 7 Feb 2013 04:42:24 -0500 Received: from redhat.com (vpn1-6-18.ams2.redhat.com [10.36.6.18]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id r179gK2L024340; Thu, 7 Feb 2013 04:42:21 -0500 Date: Thu, 7 Feb 2013 11:46:45 +0200 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <49e440fb98587efecd6ca96cbe459231fc922b9e.1360229117.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mutt-Fcc: =sent X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Anthony Liguori , "Michael S. Tsirkin" , Jan Kiszka , Jason Wang , Gerd Hoffmann , Stefan Hajnoczi , Paolo Bonzini , Amos Kong Subject: [Qemu-devel] [PATCHv2 1/2] virtio-net: remove mq feature X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org mq feature is not needed: we can look at the number of queues and set the flag accordingly. Removing this feature removes ambiguity (what does it mean to have queues=2 with mq=off?). Signed-off-by: Michael S. Tsirkin --- These are just the bits that remove the feature. The windows bug workaround can be applied separately, once we decide what it is. hw/pc_piix.c | 4 ---- hw/virtio-net.c | 4 ++++ hw/virtio-net.h | 4 +--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/hw/pc_piix.c b/hw/pc_piix.c index 0af436c..ba09714 100644 --- a/hw/pc_piix.c +++ b/hw/pc_piix.c @@ -313,10 +313,6 @@ static QEMUMachine pc_i440fx_machine_v1_4 = { .driver = "virtio-net-pci",\ .property = "ctrl_mac_addr",\ .value = "off", \ - },{ \ - .driver = "virtio-net-pci", \ - .property = "mq", \ - .value = "off", \ } static QEMUMachine pc_machine_v1_3 = { diff --git a/hw/virtio-net.c b/hw/virtio-net.c index e37358a..510a0f6 100644 --- a/hw/virtio-net.c +++ b/hw/virtio-net.c @@ -346,6 +346,10 @@ static uint32_t virtio_net_get_features(VirtIODevice *vdev, uint32_t features) features |= (1 << VIRTIO_NET_F_MAC); + if (n->max_queues > 1) { + features |= (0x1 << VIRTIO_NET_F_MQ); + } + if (!peer_has_vnet_hdr(n)) { features &= ~(0x1 << VIRTIO_NET_F_CSUM); features &= ~(0x1 << VIRTIO_NET_F_HOST_TSO4); diff --git a/hw/virtio-net.h b/hw/virtio-net.h index f5fea6e..414365d 100644 --- a/hw/virtio-net.h +++ b/hw/virtio-net.h @@ -190,7 +190,5 @@ struct virtio_net_ctrl_mq { DEFINE_PROP_BIT("ctrl_rx", _state, _field, VIRTIO_NET_F_CTRL_RX, true), \ DEFINE_PROP_BIT("ctrl_vlan", _state, _field, VIRTIO_NET_F_CTRL_VLAN, true), \ DEFINE_PROP_BIT("ctrl_rx_extra", _state, _field, VIRTIO_NET_F_CTRL_RX_EXTRA, true), \ - DEFINE_PROP_BIT("ctrl_mac_addr", _state, _field, VIRTIO_NET_F_CTRL_MAC_ADDR, true), \ - DEFINE_PROP_BIT("mq", _state, _field, VIRTIO_NET_F_MQ, true) - + DEFINE_PROP_BIT("ctrl_mac_addr", _state, _field, VIRTIO_NET_F_CTRL_MAC_ADDR, true) #endif