[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [PATCH 31/41] virtio-net: we know macs size at compile
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] Re: [PATCH 31/41] virtio-net: we know macs size at compile time, make it static |
Date: |
Wed, 2 Dec 2009 16:54:30 +0200 |
User-agent: |
Mutt/1.5.19 (2009-01-05) |
No objection to this or similar change with vlans,
but I'd like to know why was this made a separate buffer
originally.
On Wed, Dec 02, 2009 at 01:04:29PM +0100, Juan Quintela wrote:
>
> Signed-off-by: Juan Quintela <address@hidden>
> ---
> hw/virtio-net.c | 6 +-----
> 1 files changed, 1 insertions(+), 5 deletions(-)
>
> diff --git a/hw/virtio-net.c b/hw/virtio-net.c
> index c515e0e..550a814 100644
> --- a/hw/virtio-net.c
> +++ b/hw/virtio-net.c
> @@ -54,7 +54,7 @@ typedef struct VirtIONet
> uint32_t first_multi;
> uint8_t multi_overflow;
> uint8_t uni_overflow;
> - uint8_t *macs;
> + uint8_t macs[MAC_TABLE_ENTRIES * ETH_ALEN];
> } mac_table;
> uint8_t vlans[MAX_VLAN >> 3];
> } VirtIONet;
> @@ -860,8 +860,6 @@ VirtIODevice *virtio_net_init(DeviceState *dev, NICConf
> *conf)
> n->mergeable_rx_bufs = 0;
> n->promisc = 1; /* for compatibility */
>
> - n->mac_table.macs = qemu_mallocz(MAC_TABLE_ENTRIES * ETH_ALEN);
> -
> register_savevm("virtio-net", virtio_net_id++, VIRTIO_NET_VM_VERSION,
> virtio_net_save, virtio_net_load, n);
>
> @@ -876,8 +874,6 @@ void virtio_net_exit(VirtIODevice *vdev)
>
> unregister_savevm("virtio-net", n);
>
> - qemu_free(n->mac_table.macs);
> -
> qemu_del_timer(n->tx_timer);
> qemu_free_timer(n->tx_timer);
>
> --
> 1.6.5.2
- [Qemu-devel] Re: [PATCH 28/41] virtio-net: make vlan operations on uint8_t, not uint32_t, (continued)
[Qemu-devel] [PATCH 30/41] virtio-net: use save/load type chek functions for has_vent_hdr, Juan Quintela, 2009/12/02
[Qemu-devel] [PATCH 32/41] virtio-net: split virtio_net_post_load, Juan Quintela, 2009/12/02
[Qemu-devel] [PATCH 31/41] virtio-net: we know macs size at compile time, make it static, Juan Quintela, 2009/12/02
- [Qemu-devel] Re: [PATCH 31/41] virtio-net: we know macs size at compile time, make it static,
Michael S. Tsirkin <=
[Qemu-devel] [PATCH 33/41] virtio-net: port to vmstate, Juan Quintela, 2009/12/02
[Qemu-devel] Re: [PATCH 33/41] virtio-net: port to vmstate, Michael S. Tsirkin, 2009/12/02