svn commit: r244160 - projects/bhyve/usr.sbin/bhyve
Peter Grehan
grehan at FreeBSD.org
Wed Dec 12 19:45:37 UTC 2012
Author: grehan
Date: Wed Dec 12 19:45:36 2012
New Revision: 244160
URL: http://svnweb.freebsd.org/changeset/base/244160
Log:
Properly reset the tx/rx rings when a guest requests a device reset.
Obtained from: NetApp
Modified:
projects/bhyve/usr.sbin/bhyve/pci_virtio_net.c
Modified: projects/bhyve/usr.sbin/bhyve/pci_virtio_net.c
==============================================================================
--- projects/bhyve/usr.sbin/bhyve/pci_virtio_net.c Wed Dec 12 19:25:48 2012 (r244159)
+++ projects/bhyve/usr.sbin/bhyve/pci_virtio_net.c Wed Dec 12 19:45:36 2012 (r244160)
@@ -178,10 +178,29 @@ pci_vtnet_qsize(int qnum)
}
static void
+pci_vtnet_ring_reset(struct pci_vtnet_softc *sc, int ring)
+{
+ struct vring_hqueue *hq;
+
+ assert(ring < VTNET_MAXQ);
+
+ hq = &sc->vsc_hq[ring];
+
+ /*
+ * Reset all soft state
+ */
+ hq->hq_cur_aidx = 0;
+}
+
+static void
pci_vtnet_update_status(struct pci_vtnet_softc *sc, uint32_t value)
{
+
if (value == 0) {
DPRINTF(("vtnet: device reset requested !\n"));
+ pci_vtnet_ring_reset(sc, VTNET_RXQ);
+ pci_vtnet_ring_reset(sc, VTNET_TXQ);
+ sc->vsc_rx_ready = 0;
}
sc->vsc_status = value;
More information about the svn-src-projects
mailing list