rte_virtio: move vtpci reset out of virtio_dev_free
This is required for future changes. The general idea is to provide separate virtio_dev_construct and virtio_dev_init functions. construct would just allocate and setup the struct data, while init would be the one to start the device via MMIO/vhost-user. If we want to destruct a non-initialized device, there's no need to do a reset. Change-Id: Ib8ce56169e86e43fba8fcd1bf6c2a5b12ed99966 Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com> Reviewed-on: https://review.gerrithub.io/385421 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
191b45d056
commit
da5ba48996
@ -576,6 +576,7 @@ scan_target_abort(struct virtio_scsi_scan_base *base, int error)
|
||||
}
|
||||
|
||||
TAILQ_REMOVE(&g_virtio_driver.init_ctrlrs, base->vdev, tailq);
|
||||
vtpci_reset(base->vdev);
|
||||
virtio_dev_free(base->vdev);
|
||||
|
||||
|
||||
@ -1100,6 +1101,7 @@ bdev_virtio_scsi_free(struct virtio_dev *vdev)
|
||||
virtio_dev_release_queue(vdev, VIRTIO_SCSI_REQUESTQ);
|
||||
}
|
||||
|
||||
vtpci_reset(vdev);
|
||||
virtio_dev_free(vdev);
|
||||
}
|
||||
|
||||
@ -1219,6 +1221,7 @@ bdev_virtio_finish(void)
|
||||
vq->poller_ctx = NULL;
|
||||
virtio_dev_release_queue(vdev, VIRTIO_SCSI_CONTROLQ);
|
||||
}
|
||||
vtpci_reset(vdev);
|
||||
virtio_dev_free(vdev);
|
||||
}
|
||||
}
|
||||
|
@ -289,7 +289,6 @@ virtio_dev_free(struct virtio_dev *dev)
|
||||
{
|
||||
uint32_t vdev_id = dev->id;
|
||||
|
||||
vtpci_reset(dev);
|
||||
virtio_free_queues(dev);
|
||||
vtpci_ops(dev)->free_vdev(dev);
|
||||
vtpci_deinit(vdev_id);
|
||||
|
Loading…
Reference in New Issue
Block a user