virtio.lua: Fixes and optimizations.
virtio.lua: Fixes and optimizations.

Fixed ring array indexing out-of-bounds error.

Set flags so the kernel doesn't send us interrupts that we don't need.

Synchronization now checks that we really have new state to push
before executing memory barriers etc.

lukego/snabbswitch,eugeneia/snabb,mixflowtech/logsensor,snabbco/snabb,alexandergall/snabbswitch,dpino/snabbswitch,snabbco/snabb,SnabbCo/snabbswitch,heryii/snabb,plajjan/snabbswitch,eugeneia/snabb,alexandergall/snabbswitch,eugeneia/snabb,hb9cwp/snabbswitch,kbara/snabb,snabbnfv-goodies/snabbswitch,virtualopensystems/snabbswitch,Igalia/snabb,aperezdc/snabbswitch,pirate/snabbswitch,snabbco/snabb,plajjan/snabbswitch,andywingo/snabbswitch,Igalia/snabb,dwdm/snabbswitch,aperezdc/snabbswitch,andywingo/snabbswitch,dpino/snabb,andywingo/snabbswitch,dpino/snabbswitch,mixflowtech/logsensor,wingo/snabbswitch,lukego/snabbswitch,alexandergall/snabbswitch,kbara/snabb,wingo/snabb,heryii/snabb,justincormack/snabbswitch,snabbnfv-goodies/snabbswitch,Igalia/snabb,dwdm/snabbswitch,pavel-odintsov/snabbswitch,dwdm/snabbswitch,lukego/snabb,eugeneia/snabbswitch,lukego/snabbswitch,fhanik/snabbswitch,wingo/snabb,Igalia/snabb,alexandergall/snabbswitch,pirate/snabbswitch,eugeneia/snabbswitch,pavel-odintsov/snabbswitch,dpino/snabb,snabbnfv-goodies/snabbswitch,Igalia/snabb,kbara/snabb,dpino/snabbswitch,eugeneia/snabb,xdel/snabbswitch,dpino/snabb,snabbco/snabb,wingo/snabb,hb9cwp/snabbswitch,eugeneia/snabb,kbara/snabb,eugeneia/snabb,snabbco/snabb,wingo/snabb,hb9cwp/snabbswitch,xdel/snabbswitch,Igalia/snabbswitch,alexandergall/snabbswitch,Igalia/snabbswitch,aperezdc/snabbswitch,eugeneia/snabb,virtualopensystems/snabbswitch,alexandergall/snabbswitch,javierguerragiraldez/snabbswitch,heryii/snabb,lukego/snabb,justincormack/snabbswitch,mixflowtech/logsensor,wingo/snabbswitch,kellabyte/snabbswitch,snabbco/snabb,Igalia/snabbswitch,SnabbCo/snabbswitch,SnabbCo/snabbswitch,fhanik/snabbswitch,javierguerragiraldez/snabbswitch,plajjan/snabbswitch,snabbnfv-goodies/snabbswitch,heryii/snabb,justincormack/snabbswitch,pavel-odintsov/snabbswitch,javierguerragiraldez/snabbswitch,wingo/snabbswitch,plajjan/snabbswitch,eugeneia/snabbswitch,pirate/snabbswitch,lukego/snabb,dpino/snabb,virtualopensystems/snabbswitch,wingo/snabb,justincormack/snabbswitch,xdel/snabbswitch,lukego/snabb,heryii/snabb,SnabbCo/snabbswitch,Igalia/snabbswitch,dpino/snabb,Igalia/snabb,Igalia/snabb,alexandergall/snabbswitch,eugeneia/snabb,mixflowtech/logsensor,aperezdc/snabbswitch,eugeneia/snabbswitch,kbara/snabb,wingo/snabbswitch,snabbco/snabb,dpino/snabbswitch,mixflowtech/logsensor,kellabyte/snabbswitch,hb9cwp/snabbswitch,wingo/snabb,heryii/snabb,dpino/snabb,lukego/snabbswitch,andywingo/snabbswitch,snabbco/snabb,Igalia/snabbswitch,kellabyte/snabbswitch,Igalia/snabb,alexandergall/snabbswitch,kbara/snabb,dpino/snabb,fhanik/snabbswitch