class QueuePair
Defined at line 52 of file ../../src/devices/block/drivers/nvme/queue-pair.h
A QueuePair represents a completion and submission queue that are paired together.
It manages the relationship between the two.
While the spec allows many submission queues to map to one completion queue, for simplicity
we always assume there is a 1:1 relationship between the two.
This class is thread-unsafe.
Public Members
static const uint32_t kMaxTransferPages
Public Methods
zx::result<std::unique_ptr<QueuePair>> Create (zx::unowned_btibti,uint16_tqueue_id,uint32_tmax_entries,CapabilityReg ®,fdf::MmioBuffer &mmio,boolprealloc_prp)
Defined at line 19 of file ../../src/devices/block/drivers/nvme/queue-pair.cc
zx_status_t PreallocatePrpBuffers ()
Preallocates PRP buffers to avoid repeatedly allocating and freeing them for every transaction.
Defined at line 61 of file ../../src/devices/block/drivers/nvme/queue-pair.cc
void QueuePair (Queuecompletion,Queuesubmission,fbl::Vector<TransactionData>txns,zx::unowned_btibti,fdf::MmioBuffer &mmio,DoorbellRegcompletion_doorbell,DoorbellRegsubmission_doorbell)
Prefer |QueuePair::Create|.
Defined at line 63 of file ../../src/devices/block/drivers/nvme/queue-pair.h
zx_status_t CheckForNewCompletion (Completion ** completion, IoCommand ** io_cmd)
Check the completion queue for any new completed elements. Should be called from an async task
posted by the interrupt handler.
Defined at line 73 of file ../../src/devices/block/drivers/nvme/queue-pair.cc
const Queue & completion ()
Defined at line 77 of file ../../src/devices/block/drivers/nvme/queue-pair.h
const Queue & submission ()
Defined at line 78 of file ../../src/devices/block/drivers/nvme/queue-pair.h
const fbl::Vector<TransactionData> & txn_data ()
Defined at line 79 of file ../../src/devices/block/drivers/nvme/queue-pair.h
zx_status_t Submit (Submission &submission,std::optional<zx::unowned_vmo>data,zx_off_tvmo_offset,size_tbytes,IoCommand *io_cmd)
When submitting an admin command, io_cmd need not be supplied.
Defined at line 90 of file ../../src/devices/block/drivers/nvme/queue-pair.h
void RingCompletionDb ()
Defined at line 113 of file ../../src/devices/block/drivers/nvme/queue-pair.cc
Friends
class QueuePairTest