aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2015-03-15 16:09:39 +0000
committerAlexander Motin <mav@FreeBSD.org>2015-03-15 16:09:39 +0000
commit7315946b805eb2fdceb25099462bc1bdb709707e (patch)
tree8f0f7793e601c0668d31cf4f5c65641e588cc251 /usr.sbin
parente72d4950e135c6abbe6a9e390e98376857e20c87 (diff)
downloadsrc-7315946b805eb2fdceb25099462bc1bdb709707e.tar.gz
src-7315946b805eb2fdceb25099462bc1bdb709707e.zip
Fix networking problem after r280026.
I've missed that network driver sometimes returns taken request back to available queue without processing. Add new helper function for that case. Reported by: flo MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=280041
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bhyve/pci_virtio_net.c1
-rw-r--r--usr.sbin/bhyve/virtio.c17
-rw-r--r--usr.sbin/bhyve/virtio.h1
3 files changed, 17 insertions, 2 deletions
diff --git a/usr.sbin/bhyve/pci_virtio_net.c b/usr.sbin/bhyve/pci_virtio_net.c
index 8232b075a582..f3656b723b6f 100644
--- a/usr.sbin/bhyve/pci_virtio_net.c
+++ b/usr.sbin/bhyve/pci_virtio_net.c
@@ -342,6 +342,7 @@ pci_vtnet_tap_rx(struct pci_vtnet_softc *sc)
* No more packets, but still some avail ring
* entries. Interrupt if needed/appropriate.
*/
+ vq_retchain(vq);
vq_endchains(vq, 0);
return;
}
diff --git a/usr.sbin/bhyve/virtio.c b/usr.sbin/bhyve/virtio.c
index 0a750ce850e8..e985805c83f1 100644
--- a/usr.sbin/bhyve/virtio.c
+++ b/usr.sbin/bhyve/virtio.c
@@ -372,8 +372,21 @@ loopy:
}
/*
- * Return the currently-first request chain to the guest, setting
- * its I/O length to the provided value.
+ * Return the currently-first request chain back to the available queue.
+ *
+ * (This chain is the one you handled when you called vq_getchain()
+ * and used its positive return value.)
+ */
+void
+vq_retchain(struct vqueue_info *vq)
+{
+
+ vq->vq_last_avail--;
+}
+
+/*
+ * Return specified request chain to the guest, setting its I/O length
+ * to the provided value.
*
* (This chain is the one you handled when you called vq_getchain()
* and used its positive return value.)
diff --git a/usr.sbin/bhyve/virtio.h b/usr.sbin/bhyve/virtio.h
index 75d3a5349bd0..0e96a1d3b0c8 100644
--- a/usr.sbin/bhyve/virtio.h
+++ b/usr.sbin/bhyve/virtio.h
@@ -453,6 +453,7 @@ void vi_set_io_bar(struct virtio_softc *, int);
int vq_getchain(struct vqueue_info *vq, uint16_t *pidx,
struct iovec *iov, int n_iov, uint16_t *flags);
+void vq_retchain(struct vqueue_info *vq);
void vq_relchain(struct vqueue_info *vq, uint16_t idx, uint32_t iolen);
void vq_endchains(struct vqueue_info *vq, int used_all_avail);