[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 15/61] virtio-net : show the VirtIONet structure.
From: |
fred . konrad |
Subject: |
[Qemu-devel] [PATCH 15/61] virtio-net : show the VirtIONet structure. |
Date: |
Mon, 7 Jan 2013 19:40:28 +0100 |
From: KONRAD Frederic <address@hidden>
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 <address@hidden>
---
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
--
1.7.11.7
- [Qemu-devel] [PATCH 05/61] virtio-device : refactor virtio-device., (continued)
- [Qemu-devel] [PATCH 05/61] virtio-device : refactor virtio-device., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 07/61] virtio-s390-device : create a virtio-s390-bus during init., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 08/61] virtio-blk : show VirtIOBlock structure., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 09/61] virtio-blk : don't use pointer for configuration., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 10/61] virtio-blk : add the virtio-blk device., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 12/61] virtio-blk-s390 : switch to the new API., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 11/61] virtio-blk-pci : switch to new API., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 14/61] virtio-blk : cleanup : remove qdev field., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 16/61] virtio-net : add the virtio-net device., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 17/61] virtio-net-pci : switch to the new API., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 15/61] virtio-net : show the VirtIONet structure.,
fred . konrad <=
- [Qemu-devel] [PATCH 13/61] virtio-blk : cleanup : use QOM cast., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 20/61] virtio-net : cleanup : init and exit function., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 18/61] virtio-net-s390 : switch to the new API., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 23/61] virtio-scsi : don't use pointer for configuration., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 21/61] virtio-net : cleanup : remove qdev field., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 19/61] virtio-net : cleanup : use QOM cast., fred . konrad, 2013/01/07