rename nvme_ctrlr_destroy_qpair to nvme_ctrlr_destroy_qpairs
Maintain symmetry with nvme_ctrlr_create_qpairs, making it easier to match init/uninit scenarios. Signed-off-by: John Meneghini <johnm@netapp.com> Submitted by: Michael Hordijk <hordijk@netapp.com> Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D19781
This commit is contained in:
parent
4fb95008ed
commit
a6348661f0
@ -515,28 +515,33 @@ nvme_ctrlr_create_qpairs(struct nvme_controller *ctrlr)
|
||||
}
|
||||
|
||||
static int
|
||||
nvme_ctrlr_destroy_qpair(struct nvme_controller *ctrlr, struct nvme_qpair *qpair)
|
||||
nvme_ctrlr_destroy_qpairs(struct nvme_controller *ctrlr)
|
||||
{
|
||||
struct nvme_completion_poll_status status;
|
||||
struct nvme_qpair *qpair;
|
||||
|
||||
status.done = 0;
|
||||
nvme_ctrlr_cmd_delete_io_sq(ctrlr, qpair,
|
||||
nvme_completion_poll_cb, &status);
|
||||
while (!atomic_load_acq_int(&status.done))
|
||||
pause("nvme", 1);
|
||||
if (nvme_completion_is_error(&status.cpl)) {
|
||||
nvme_printf(ctrlr, "nvme_destroy_io_sq failed!\n");
|
||||
return (ENXIO);
|
||||
}
|
||||
for (int i = 0; i < ctrlr->num_io_queues; i++) {
|
||||
qpair = &ctrlr->ioq[i];
|
||||
|
||||
status.done = 0;
|
||||
nvme_ctrlr_cmd_delete_io_cq(ctrlr, qpair,
|
||||
nvme_completion_poll_cb, &status);
|
||||
while (!atomic_load_acq_int(&status.done))
|
||||
pause("nvme", 1);
|
||||
if (nvme_completion_is_error(&status.cpl)) {
|
||||
nvme_printf(ctrlr, "nvme_destroy_io_cq failed!\n");
|
||||
return (ENXIO);
|
||||
status.done = 0;
|
||||
nvme_ctrlr_cmd_delete_io_sq(ctrlr, qpair,
|
||||
nvme_completion_poll_cb, &status);
|
||||
while (!atomic_load_acq_int(&status.done))
|
||||
pause("nvme", 1);
|
||||
if (nvme_completion_is_error(&status.cpl)) {
|
||||
nvme_printf(ctrlr, "nvme_destroy_io_sq failed!\n");
|
||||
return (ENXIO);
|
||||
}
|
||||
|
||||
status.done = 0;
|
||||
nvme_ctrlr_cmd_delete_io_cq(ctrlr, qpair,
|
||||
nvme_completion_poll_cb, &status);
|
||||
while (!atomic_load_acq_int(&status.done))
|
||||
pause("nvme", 1);
|
||||
if (nvme_completion_is_error(&status.cpl)) {
|
||||
nvme_printf(ctrlr, "nvme_destroy_io_cq failed!\n");
|
||||
return (ENXIO);
|
||||
}
|
||||
}
|
||||
|
||||
return (0);
|
||||
@ -1314,8 +1319,8 @@ nvme_ctrlr_destruct(struct nvme_controller *ctrlr, device_t dev)
|
||||
if (ctrlr->cdev)
|
||||
destroy_dev(ctrlr->cdev);
|
||||
|
||||
nvme_ctrlr_destroy_qpairs(ctrlr);
|
||||
for (i = 0; i < ctrlr->num_io_queues; i++) {
|
||||
nvme_ctrlr_destroy_qpair(ctrlr, &ctrlr->ioq[i]);
|
||||
nvme_io_qpair_destroy(&ctrlr->ioq[i]);
|
||||
}
|
||||
free(ctrlr->ioq, M_NVME);
|
||||
|
Loading…
Reference in New Issue
Block a user