buffer.free: call return_virtio_buffer directly
transmit_packets_to_vm: localize more
net_device: % -> band
allow lib.malloc to take ffi.typeof'd argument, use that inside loops
transmit_packets_to_vm: temporary variable was global
memory is a global module now
memory init: call lib.hardware.bus to set appropriate allocator
new memory.malloc (utilizing either C.malloc or dma_alloc). Use it in lib.malloc
packet: kill packets array, use memory.alloc for packets allocation
Merge pull request #229 from llelf/main2

speed-ups
virtio: print feature names upon negotiation

Signed-off-by: Nikolay Nikolaev <n.nikolaev@virtualopensystems.com>
net_device: Refactor vrings

Add a VirtioVirtq class, that will handle the generic virt queue opertions:

 - get_buffer (from available ring)
 - put buffer (to used ring)
 - signal used (that a buffer was put to used ring)

This lowers down the packets per second performance to 2Mpps.

Adds support for VIRTIO_F_ANY_LAYOUT.

Signed-off-by: Nikolay Nikolaev <n.nikolaev@virtualopensystems.com>
virtio: supoprt indirect descirptors

On an unpatched QEMU, netperf with TCP_STREAM:

 - no indirect descriptors   - 2644.37 Mbps
 - with indirect descriptors - 4275.32 Mbps

Signed-off-by: Nikolay Nikolaev <n.nikolaev@virtualopensystems.com>