On 2019/2/11 下午10:52, Michael S. Tsirkin wrote:
On Mon, Feb 11, 2019 at 04:40:44PM +0300, Anton Kuchin wrote:
As far as I can see currently IOThread offloading is used only for block
devices and all others are emulated by main thread.
I expect that network devices can also benefit from processing in separate
thread but I couldn't find any recent work in this direction. I'm going to
implement a PoC but I want to ask if you know any previous attempts and do
you know why it can be a total waste of time. Are there fundamental
obstacles that prevent network emulation handling in IOThread?
No but vhost-net is there. Unlike block where you gain lots of
functionality such as snapshots there seems to be little to
be gained by doing it in userspace.
I think all the three (vhost-net, vhost-user, vhost-dataplane) have
their own advantages. E.g compared to vhost-user, vhost dataplane in
qemu has the following advantages:
- Qemu dataplane could be much safer, e.g there's no need to share all
its memory to another process.
- Easy to develop, there's no need for the backend to know anything
about virtio. This will reduce the pain of maintaining compatibility,
version etc. New features was limited to the changes of qemu itself.
- Faster access of VM metadata, Device IOTLB and RSS/Steering could be
function calls instead of complex vhost-user protocol. I'm pretty sure
we will hit more similar issues in the future.
And I can consider some use cases:
- link dpdk to qemu
- implement fast userspace backend like AF_XDP, netmap, packet socket or
other (or even achieve this through dpdk pmd)
Thanks