summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2015-03-15 16:09:39 +0000
committermav <mav@FreeBSD.org>2015-03-15 16:09:39 +0000
commit2088070eaf7aa449b906195cdaf1149b3f342b09 (patch)
tree8f0f7793e601c0668d31cf4f5c65641e588cc251 /usr.sbin
parentcd363583ce0ed939509a7f80e1b3be92340d013e (diff)
downloadFreeBSD-src-2088070eaf7aa449b906195cdaf1149b3f342b09.zip
FreeBSD-src-2088070eaf7aa449b906195cdaf1149b3f342b09.tar.gz
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
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 8232b07..f3656b7 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 0a750ce..e985805 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 75d3a53..0e96a1d 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);
OpenPOWER on IntegriCloud