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_bti bti, uint16_t queue_id, uint32_t max_entries, CapabilityReg & reg, fdf::MmioBuffer & mmio, bool prealloc_prp)

Defined at line 18 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 60 of file ../../src/devices/block/drivers/nvme/queue-pair.cc

void QueuePair (Queue completion, Queue submission, fbl::Vector<TransactionData> txns, zx::unowned_bti bti, fdf::MmioBuffer & mmio, DoorbellReg completion_doorbell, DoorbellReg submission_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 72 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_t vmo_offset, size_t bytes, 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 112 of file ../../src/devices/block/drivers/nvme/queue-pair.cc

Friends

class QueuePairTest