summaryrefslogtreecommitdiffstats
path: root/src/drivers/bus
diff options
context:
space:
mode:
authorLadi Prosek2016-12-16 13:31:22 +0100
committerMichael Brown2017-01-22 14:20:42 +0100
commitb782a56be725569fb68f92b81a01903d1652c5b0 (patch)
treec07056af08630fbdb6e0ea2c99c5245fb2e0f0fe /src/drivers/bus
parent[virtio] Cap queue size to MAX_QUEUE_NUM (diff)
downloadipxe-b782a56be725569fb68f92b81a01903d1652c5b0.tar.gz
ipxe-b782a56be725569fb68f92b81a01903d1652c5b0.tar.xz
ipxe-b782a56be725569fb68f92b81a01903d1652c5b0.zip
[virtio] Simplify virtqueue shutdown
This commit introduces virtnet_free_virtqueues called on all virtqueue error and shutdown paths. vpm_find_vqs no longer cleans up after itself and instead expects virtnet_free_virtqueues to be always called to undo its effect. Signed-off-by: Ladi Prosek <lprosek@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/drivers/bus')
-rw-r--r--src/drivers/bus/virtio-pci.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/drivers/bus/virtio-pci.c b/src/drivers/bus/virtio-pci.c
index 1fcf9bae..c50602a3 100644
--- a/src/drivers/bus/virtio-pci.c
+++ b/src/drivers/bus/virtio-pci.c
@@ -391,7 +391,7 @@ int vpm_find_vqs(struct virtio_pci_modern_device *vdev,
off * notify_offset_multiplier, 2,
&vq->notification);
if (err) {
- goto err_map_notify;
+ return err;
}
}
@@ -405,11 +405,4 @@ int vpm_find_vqs(struct virtio_pci_modern_device *vdev,
vpm_iowrite16(vdev, &vdev->common, 1, COMMON_OFFSET(queue_enable));
}
return 0;
-
-err_map_notify:
- /* Undo the virtio_pci_map_capability calls. */
- while (i-- > 0) {
- virtio_pci_unmap_capability(&vqs[i].notification);
- }
- return err;
}