On Fri, Feb 22, 2013 at 11:15:06PM +0800, Jason Wang wrote:
> Edivaldo reports a problem that the array of NetClientState in NICState is too
> large - MAX_QUEUE_NUM(1024) which will wastes memory even if multiqueue is not
> used.
> 
> Instead of static arrays, solving this issue by allocating the queues on 
> demand
> for both the NetClientState array in NICState and VirtIONetQueue array in
> VirtIONet.
> 
> Tested by myself, with single virtio-net-pci device. The memory allocation is
> almost the same as when multiqueue is not merged.
> 
> Cc: Edivaldo de Araujo Pereira <[email protected]>
> Cc: [email protected]
> Signed-off-by: Jason Wang <[email protected]>
> ---
> Changes from V1:
> - Fix use after free (Stefan).
> ---
>  hw/virtio-net.c   |    6 ++++--
>  include/net/net.h |    2 +-
>  net/net.c         |   19 +++++++++----------
>  3 files changed, 14 insertions(+), 13 deletions(-)

Thanks, applied to my net tree:
https://github.com/stefanha/qemu/commits/net

Stefan

Reply via email to