On 2020/4/7 下午3:55, Jason Wang wrote:
Hi all:
To get native performance of VF, we need to map doorbell to guest to
avoid unnecessary vmexit. In order to do this, we will launch qemu
with page-per-vq=on. This means the each doorbell register should be
located at the beginning of 4K page and does not share the page with
other registers.
After discussion with some vendors. We can relax such requirement by
extending qemu to support doorbells like:
1) doorbell registers should exclusively own one or more pages
2) The location of the each doorbell register could be calculated as the
algorithm described in the specification (4.1.4.4)
Then qemu can map them safely to guest through virtio-pci.
For virtio-mmio, we will extend the spec to support the same doorbell
layouts.
Thanks
Then vDPA framework can safely map it into the guest physical address
(GPA) range defined by qemu. It could be either
1) a single doorbell register that is used by all virtqueues
or
2) several different per-vq doorbell registers
If you decide to implement a virtio-pci register layout, need to make
sure for notification structure (4.1.4.4 of virtio spec):
For each virtqueue, the result
ofcap.offset+queue_notify_off*notify_off_multiplier is PAGE_SIZE (e.g
4K) alignment, and the doorbeel does not share the page with other
registers.
And it would be better if queue_notify_off, notify_off_multiplier can
be changed via firmware for extra flexibility.
Please check and make sure your hardware have such ability and feel
free to ask if you have questions (offline if necessary).
Thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]