From patchwork Mon Jan 7 18:40:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: fred.konrad@greensocs.com X-Patchwork-Id: 210055 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 53D7A2C0087 for ; Tue, 8 Jan 2013 06:13:35 +1100 (EST) Received: from localhost ([::1]:49706 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsHf6-0005xP-Hn for incoming@patchwork.ozlabs.org; Mon, 07 Jan 2013 13:43:04 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56285) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsHe0-0004D2-3E for qemu-devel@nongnu.org; Mon, 07 Jan 2013 13:41:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TsHdy-0005mR-Su for qemu-devel@nongnu.org; Mon, 07 Jan 2013 13:41:55 -0500 Received: from greensocs.com ([87.106.252.221]:52742 helo=s15328186.onlinehome-server.info) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsHdy-0005m9-Ip for qemu-devel@nongnu.org; Mon, 07 Jan 2013 13:41:54 -0500 Received: from localhost (unknown [127.0.0.1]) by s15328186.onlinehome-server.info (Postfix) with ESMTP id DB24F439E3D; Mon, 7 Jan 2013 18:41:53 +0000 (UTC) Received: from s15328186.onlinehome-server.info ([127.0.0.1]) by localhost (s15328186.onlinehome-server.info [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DA22ZzLk68dw; Mon, 7 Jan 2013 19:41:51 +0100 (CET) Received: by s15328186.onlinehome-server.info (Postfix, from userid 491) id EA2D5439E42; Mon, 7 Jan 2013 19:41:48 +0100 (CET) Received: from compaq.katmai.xl.cx.katmai.xl.cx (lan31-11-83-155-143-136.fbx.proxad.net [83.155.143.136]) by s15328186.onlinehome-server.info (Postfix) with ESMTPSA id 1F530439E45; Mon, 7 Jan 2013 19:41:47 +0100 (CET) From: fred.konrad@greensocs.com To: qemu-devel@nongnu.org, aliguori@us.ibm.com Date: Mon, 7 Jan 2013 19:40:28 +0100 Message-Id: <1357584074-10852-16-git-send-email-fred.konrad@greensocs.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1357584074-10852-1-git-send-email-fred.konrad@greensocs.com> References: <1357584074-10852-1-git-send-email-fred.konrad@greensocs.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 87.106.252.221 Cc: kwolf@redhat.com, peter.maydell@linaro.org, e.voevodin@samsung.com, mst@redhat.com, mark.burton@greensocs.com, agraf@suse.de, amit.shah@redhat.com, aneesh.kumar@linux.vnet.ibm.com, stefanha@redhat.com, cornelia.huck@de.ibm.com, pbonzini@redhat.com, afaerber@suse.de, fred.konrad@greensocs.com Subject: [Qemu-devel] [PATCH 15/61] virtio-net : show the VirtIONet structure. 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 From: KONRAD Frederic As we discuss with anthony and andreas, this structure must be showed to avoid two memory allocations for virtio-net-x. Signed-off-by: KONRAD Frederic --- hw/virtio-net.c | 41 ----------------------------------------- hw/virtio-net.h | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/hw/virtio-net.c b/hw/virtio-net.c index 5d03b31..4ece6c2 100644 --- a/hw/virtio-net.c +++ b/hw/virtio-net.c @@ -26,47 +26,6 @@ #define MAC_TABLE_ENTRIES 64 #define MAX_VLAN (1 << 12) /* Per 802.1Q definition */ -typedef struct VirtIONet -{ - VirtIODevice vdev; - uint8_t mac[ETH_ALEN]; - uint16_t status; - VirtQueue *rx_vq; - VirtQueue *tx_vq; - VirtQueue *ctrl_vq; - NICState *nic; - QEMUTimer *tx_timer; - QEMUBH *tx_bh; - uint32_t tx_timeout; - int32_t tx_burst; - int tx_waiting; - uint32_t has_vnet_hdr; - size_t host_hdr_len; - size_t guest_hdr_len; - uint8_t has_ufo; - struct { - VirtQueueElement elem; - ssize_t len; - } async_tx; - int mergeable_rx_bufs; - uint8_t promisc; - uint8_t allmulti; - uint8_t alluni; - uint8_t nomulti; - uint8_t nouni; - uint8_t nobcast; - uint8_t vhost_started; - struct { - int in_use; - int first_multi; - uint8_t multi_overflow; - uint8_t uni_overflow; - uint8_t *macs; - } mac_table; - uint32_t *vlans; - DeviceState *qdev; -} VirtIONet; - /* TODO * - we could suppress RX interrupt if we were so inclined. */ diff --git a/hw/virtio-net.h b/hw/virtio-net.h index d46fb98..f6ff85d 100644 --- a/hw/virtio-net.h +++ b/hw/virtio-net.h @@ -124,6 +124,47 @@ struct virtio_net_ctrl_mac { uint32_t entries; uint8_t macs[][ETH_ALEN]; }; + +typedef struct VirtIONet { + VirtIODevice vdev; + uint8_t mac[ETH_ALEN]; + uint16_t status; + VirtQueue *rx_vq; + VirtQueue *tx_vq; + VirtQueue *ctrl_vq; + NICState *nic; + QEMUTimer *tx_timer; + QEMUBH *tx_bh; + uint32_t tx_timeout; + int32_t tx_burst; + int tx_waiting; + uint32_t has_vnet_hdr; + size_t host_hdr_len; + size_t guest_hdr_len; + uint8_t has_ufo; + struct { + VirtQueueElement elem; + ssize_t len; + } async_tx; + int mergeable_rx_bufs; + uint8_t promisc; + uint8_t allmulti; + uint8_t alluni; + uint8_t nomulti; + uint8_t nouni; + uint8_t nobcast; + uint8_t vhost_started; + struct { + int in_use; + int first_multi; + uint8_t multi_overflow; + uint8_t uni_overflow; + uint8_t *macs; + } mac_table; + uint32_t *vlans; + DeviceState *qdev; +} VirtIONet; + #define VIRTIO_NET_CTRL_MAC 1 #define VIRTIO_NET_CTRL_MAC_TABLE_SET 0