virtio-net: a multi-queue guest driver, one queue pair per shard
Net.Front now brings up N receive/transmit pairs, not one. connect takes
?queue_pairs: more than one negotiates VIRTIO_NET_F_MQ and the control virtqueue,
clamps the count to the device's advertised max_virtqueue_pairs, programs
virtqueues 2p/2p+1 per pair plus the control queue, and posts
VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET (Virtio_net.ctrl_mq_set) to bring the extra pairs
online. The device is a set of independent queue handles -- send/receive/failed
act on a queue, mac/mtu/queues/queue_count on the device -- so one share-nothing
stack shard drives each pair: this is the guest side of scaling the sharded TCP
stack past a single queue's ceiling.
Net.Back gains service_ctrl, the device mirror that applies the pairs-set command
and acknowledges it, so the loopback oracle is faithful. The Mmio model now
serves a config word that runs off the end of the config by zero-padding its
tail, as a real device does, so a two-byte field like max_virtqueue_pairs at the
config tail reads correctly.
test_net_device drives three pairs end to end: each carries its own frame both
ways over its own virtqueues, and the device services the pairs-set command.