nvme: add priority field to qpair

Set up the infrastructure for creating I/O submission queues with
variable queue priority (QPRIO in Create I/O SQ command).

Currently, this is unused, since we always use the default arbitration
method (round robin), but it will allow reinitializing submission queues
with the correct priority once weighted round robin is supported.

Change-Id: I425003879e624cfcc9687bdc495b5c1726b5a8af
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Daniel Verkamp 2016-02-29 14:43:08 -07:00
parent 0b2848ffb8
commit df26ab0583
3 changed files with 4 additions and 1 deletions

View File

@ -182,7 +182,7 @@ nvme_ctrlr_cmd_create_io_sq(struct spdk_nvme_ctrlr *ctrlr,
*/
cmd->cdw10 = ((io_que->num_entries - 1) << 16) | io_que->id;
/* 0x1 = physically contiguous */
cmd->cdw11 = (io_que->id << 16) | 0x1;
cmd->cdw11 = (io_que->id << 16) | (io_que->qprio << 1) | 0x1;
cmd->dptr.prp.prp1 = io_que->cmd_bus_addr;
nvme_ctrlr_submit_admin_request(ctrlr, req);

View File

@ -275,6 +275,8 @@ struct spdk_nvme_qpair {
uint64_t cmd_bus_addr;
uint64_t cpl_bus_addr;
uint8_t qprio;
};
struct spdk_nvme_ns {

View File

@ -536,6 +536,7 @@ nvme_qpair_construct(struct spdk_nvme_qpair *qpair, uint16_t id,
qpair->id = id;
qpair->num_entries = num_entries;
qpair->qprio = 0;
qpair->ctrlr = ctrlr;