According to the NVMe specification, the BAR has tail and head fields for each queue. For example:
- Submission Queue
y
Tail Doorbell (SQyTDBL
):- Start:
1000h + (2y * (4 << CAP.DSTRD))
- End:
1003h + (2y * (4 << CAP.DSTRD))
- Start:
- Submission Queue
y
Head Doorbell (SQyHDBL
):- Start:
1000h + ((2y + 1) * (4 << CAP.DSTRD))
- End:
1003h + ((2y + 1) * (4 << CAP.DSTRD))
- Start:
Are there the queue itself or just mere pointers? Is this correct? If it is the queue, I would assume the DSTRD indicates the maximum length of all queues.
Moreover, the specification talks about two optional regions: Host Memory Buffer (HMB) and Controller Memory Buffer (CMB).
- HMB: a region within the host's DRAM (PCIe root)
- CMB: a region within the NVMe controller's DRAM (inside the SSD)
If both are optional, where is it located then? Since endpoint PCIe only works with BARs and PCI Headers, I don't see any other place they might be located, other than a BAR.