Properly reset the tx/rx rings when a guest requests a device reset.

Obtained from:	NetApp
This commit is contained in:
Peter Grehan 2012-12-12 19:45:36 +00:00
parent 100ace48f3
commit 31f78e49b3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/projects/bhyve/; revision=244160

View File

@ -177,11 +177,30 @@ pci_vtnet_qsize(int qnum)
return (VTNET_RINGSZ);
}
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;