Hey all,
I am using qemu-system-arm with "-device virtio-net-device" to emulate a
nic (mmio, legacy). I have noticed that a receive queue uses the same
buffer multiple times, although it has been added to the used ring (and
not been added to the available ring again). Is it allowed to do that?
This is the first buffer (index 0) in the descriptor table:
(gdb) x/16x 0x46008000
0x46008000: 0x00000000 0x00000000 0xffff0000 0xffffffff
0x46008010: 0x000a5552 0x06080202 0x00080100 0x01000406
0x46008020: 0x000a5552 0x000a0202 0x00000202 0x00000000
0x46008030: 0x0f02000a 0x00000000 0x00000000 0x00000000
As you can see it contains a legacy virtio_net_hdr and an ethernet frame
with an arp packet.
After receiving two such arp packets the used ring looks like this:
(gdb) x/8x 0x46005000
0x46005000: 0x00020001 0x00000000 0x00000034 0x00000000
0x46005010: 0x00000034 0x00000000 0x00000000 0x00000000
The used index is 2, and both entries use the first buffer in the
descriptor table (0). The virtio 1.1 spec says in section 2.6.8 ("The
Virtqueue Used Ring"): "The used ring is where the device returns
buffers once it is done with them". I'd expect that any buffer that
appears in the used ring will not be touched by the device (unless the
driver puts it into an available ring again).
Is my interpretation of the phrasing wrong, or is the device misbehaving?
Kind regards,
Benni
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]