Notes about NVMe Shadow doorbell buffer
文章目录
本文将介绍下NVMe中的Shadow doorbell buffer机制。
Overview
The guest driver only writes to the MMIO register when EventIdx has been reached. This eliminates some MMIO writes.
Identify
可以参考hw/nvme: Implement shadow doorbell buffer support中的NVME_OACS_DBBUF = 1 << 8
。
Doorbell Buffer Config command
doorbell values are written by the nvme driver (guest OS) and the event index is written by the virtual device (host OS).
The Doorbell Buffer Config admin command is implemented for the guest to enable shadow doobell buffer. When this feature is enabled, each SQ/CQ is associated with two buffers, i.e., Shadow Doorbell buffer and EventIdx buffer. According to the Spec, each queue’s doorbell register is only updated when the Shadow Doorbell buffer value changes from being less than or equal to the value of the corresponding EventIdx buffer entry to being greater than that value. Therefore, the number of MMIO’s on the doorbell registers is greatly reduced.
Updating Controller Doorbell Registers using a Shadow Doorbell Buffer
参考资料:
- https://nvmexpress.org/wp-content/uploads/NVM_Express_Revision_1.3.pdf
- block/NVMe: introduce a new vhost NVMe host device to QEMU
- nvme: improve performance for virtual NVMe devices
- Accelerating NVMe I/Os in Virtual Machine via SPDK vhost* Solution
- hw/nvme: Add shadow doorbell buffer support
- hw/nvme: Implement shadow doorbell buffer support