summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bhyve/pci_virtio_rnd.c
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2015-03-27 08:52:57 +0000
committermav <mav@FreeBSD.org>2015-03-27 08:52:57 +0000
commitaaa4bfa29497aab9c1f33620881bea8ca70e7865 (patch)
tree25c45b5ac48ea187687cd2a073513f80ecb99080 /usr.sbin/bhyve/pci_virtio_rnd.c
parent3cab0e383150be183450000ede57f24643d45155 (diff)
downloadFreeBSD-src-aaa4bfa29497aab9c1f33620881bea8ca70e7865.zip
FreeBSD-src-aaa4bfa29497aab9c1f33620881bea8ca70e7865.tar.gz
MFC r280026, r280041:
Modify virtqueue helpers added in r253440 to allow queuing. Original virtqueue design allows queued and out-of-order processing, but helpers added in r253440 suppose only direct blocking in-order one. It could be fine for network, etc., but it is a huge limitation for storage devices.
Diffstat (limited to 'usr.sbin/bhyve/pci_virtio_rnd.c')
-rw-r--r--usr.sbin/bhyve/pci_virtio_rnd.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.sbin/bhyve/pci_virtio_rnd.c b/usr.sbin/bhyve/pci_virtio_rnd.c
index 0a31080..92d1d6f 100644
--- a/usr.sbin/bhyve/pci_virtio_rnd.c
+++ b/usr.sbin/bhyve/pci_virtio_rnd.c
@@ -103,18 +103,17 @@ pci_vtrnd_notify(void *vsc, struct vqueue_info *vq)
struct iovec iov;
struct pci_vtrnd_softc *sc;
int len;
+ uint16_t idx;
sc = vsc;
- vq_startchains(vq);
-
if (sc->vrsc_fd < 0) {
vq_endchains(vq, 0);
return;
}
while (vq_has_descs(vq)) {
- vq_getchain(vq, &iov, 1, NULL);
+ vq_getchain(vq, &idx, &iov, 1, NULL);
len = read(sc->vrsc_fd, iov.iov_base, iov.iov_len);
@@ -126,7 +125,7 @@ pci_vtrnd_notify(void *vsc, struct vqueue_info *vq)
/*
* Release this chain and handle more
*/
- vq_relchain(vq, len);
+ vq_relchain(vq, idx, len);
}
vq_endchains(vq, 1); /* Generate interrupt if appropriate. */
}
OpenPOWER on IntegriCloud