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>
virtio: add MQ

Signed-off-by: Nikolay Nikolaev <n.nikolaev@virtualopensystems.com>
bench: add multi queue support

Signed-off-by: Nikolay Nikolaev <n.nikolaev@virtualopensystems.com>
cache virtq:get_buffers, change its args

Reviewed-by: Nikolay Nikolaev <n.nikolaev@virtualopensystems.com>
net_device+virtq: localize data; “flatten” all args and returns

The latter is ugly'ish, but with it luajit is able to preform
allocation sinking optimizations and at least this part is totally
gc-free. ~4Mpps

Reviewed-by: Nikolay Nikolaev <n.nikolaev@virtualopensystems.com>
virtio net: support 'struct virtio_net_hdr_mrg_rxbuf'

The virtio-net header is sligltly bigger when MRG_RXBUF is negotiated.

Signed-off-by: Nikolay Nikolaev <n.nikolaev@virtualopensystems.com>
virtio: mergeable rx buffers

Negotiate MRG_RXBUF and support multi-iovec packet transmission to VM.
This basically enables Jumbo Ethernet frames.

Signed-off-by: Nikolay Nikolaev <n.nikolaev@virtualopensystems.com>
Merge pull request #286 from virtualopensystems/virtio_features

Virtio features
receive checksum offload
transmit checksum offload
the "insert checksum" bits of TXDESC must reflect the current context
precalculate the offload flags together with the context descriptor
check if the packet needs checksum before asking the chip to do it