nvme: remove per_cpu_io_queues from struct nvme_controller

Instead just use num_io_queues to make this determination.

This prepares for some future changes enabling use of multiple
queues when we do not have enough queues or MSI-X vectors
for one queue per CPU.

MFC after:	3 days
Sponsored by:	Intel
This commit is contained in:
jimharris 2016-01-07 16:09:56 +00:00
parent 5fd9219620
commit 6f7e8e5393
2 changed files with 3 additions and 9 deletions

View File

@ -160,7 +160,7 @@ nvme_ctrlr_construct_io_qpairs(struct nvme_controller *ctrlr)
num_trackers,
ctrlr);
if (ctrlr->per_cpu_io_queues)
if (ctrlr->num_io_queues > 1)
bus_bind_intr(ctrlr->dev, qpair->res, i);
}
@ -402,7 +402,6 @@ nvme_ctrlr_set_num_qpairs(struct nvme_controller *ctrlr)
nvme_io_qpair_destroy(&ctrlr->ioq[i]);
ctrlr->num_io_queues = 1;
ctrlr->per_cpu_io_queues = 0;
}
return (0);
@ -779,7 +778,6 @@ nvme_ctrlr_configure_intx(struct nvme_controller *ctrlr)
{
ctrlr->num_io_queues = 1;
ctrlr->per_cpu_io_queues = 0;
ctrlr->rid = 0;
ctrlr->res = bus_alloc_resource_any(ctrlr->dev, SYS_RES_IRQ,
&ctrlr->rid, RF_SHAREABLE | RF_ACTIVE);
@ -969,9 +967,8 @@ nvme_ctrlr_construct(struct nvme_controller *ctrlr, device_t dev)
per_cpu_io_queues = 1;
TUNABLE_INT_FETCH("hw.nvme.per_cpu_io_queues", &per_cpu_io_queues);
ctrlr->per_cpu_io_queues = per_cpu_io_queues ? TRUE : FALSE;
if (ctrlr->per_cpu_io_queues)
if (per_cpu_io_queues)
ctrlr->num_io_queues = mp_ncpus;
else
ctrlr->num_io_queues = 1;
@ -1002,7 +999,6 @@ nvme_ctrlr_construct(struct nvme_controller *ctrlr, device_t dev)
}
if (pci_msix_count(dev) < num_vectors_requested) {
ctrlr->per_cpu_io_queues = FALSE;
ctrlr->num_io_queues = 1;
num_vectors_requested = 2; /* one for admin, one for I/O */
}
@ -1020,7 +1016,6 @@ nvme_ctrlr_construct(struct nvme_controller *ctrlr, device_t dev)
goto intx;
}
ctrlr->per_cpu_io_queues = FALSE;
ctrlr->num_io_queues = 1;
/*
* Release whatever vectors were allocated, and just
@ -1192,7 +1187,7 @@ nvme_ctrlr_submit_io_request(struct nvme_controller *ctrlr,
{
struct nvme_qpair *qpair;
if (ctrlr->per_cpu_io_queues)
if (ctrlr->num_io_queues > 1)
qpair = &ctrlr->ioq[curcpu];
else
qpair = &ctrlr->ioq[0];

View File

@ -265,7 +265,6 @@ struct nvme_controller {
uint32_t enable_aborts;
uint32_t num_io_queues;
boolean_t per_cpu_io_queues;
/* Fields for tracking progress during controller initialization. */
struct intr_config_hook config_hook;