Skip to content

Commit

Permalink
OS-6874 viona should untangle status and flags
Browse files Browse the repository at this point in the history
OS-6883 viona needs design prose
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Mike Gerdts <mike.gerdts@joyent.com>
Approved by: Mike Gerdts <mike.gerdts@joyent.com>
  • Loading branch information
pfmooney committed Apr 12, 2018
1 parent a28d612 commit 4dae3eb
Show file tree
Hide file tree
Showing 2 changed files with 293 additions and 59 deletions.
26 changes: 16 additions & 10 deletions usr/src/cmd/bhyve/pci_virtio_viona.c
Expand Up @@ -155,25 +155,31 @@ pci_viona_qsize(struct pci_viona_softc *sc, int qnum)
static void
pci_viona_ring_reset(struct pci_viona_softc *sc, int ring)
{
int error;

assert(ring < VIONA_MAXQ);

switch (ring) {
case VIONA_RXQ:
case VIONA_TXQ:
error = ioctl(sc->vsc_vnafd, VNA_IOC_RING_RESET, ring);
if (error != 0) {
WPRINTF(("ioctl viona ring %u reset failed %d\n",
ring, errno));
} else {
sc->vsc_pfn[ring] = 0;
}
break;
case VIONA_CTLQ:
default:
break;
return;
}

for (;;) {
int res;

res = ioctl(sc->vsc_vnafd, VNA_IOC_RING_RESET, ring);
if (res == 0) {
break;
} else if (errno != EINTR) {
WPRINTF(("ioctl viona ring %d reset failed %d\n",
ring, errno));
return;
}
}

sc->vsc_pfn[ring] = 0;
}

static void
Expand Down

0 comments on commit 4dae3eb

Please sign in to comment.