Try to get more packets going if the transmit interrupt indicates

some were sent.  Doing so avoids a situation where vioif_start never
gets called in case the sendqueue fills up and therefore the interface
perpetually drops all packets due to the queue being full.
(not sure why all drivers need to do this themselves; just keeping
up with the joneses)

Problem reported and patch tested by jmmlmendes and yasukata at
repo.rumpkernel.org/rumprun
This commit is contained in:
pooka 2016-05-17 10:05:31 +00:00
parent c80063823d
commit 7608448abe
1 changed files with 5 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_vioif.c,v 1.22 2016/02/09 08:32:11 ozaki-r Exp $ */
/* $NetBSD: if_vioif.c,v 1.23 2016/05/17 10:05:31 pooka Exp $ */
/*
* Copyright (c) 2010 Minoura Makoto.
@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.22 2016/02/09 08:32:11 ozaki-r Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.23 2016/05/17 10:05:31 pooka Exp $");
#ifdef _KERNEL_OPT
#include "opt_net_mpsafe.h"
@ -1116,6 +1116,7 @@ vioif_tx_vq_done(struct virtqueue *vq)
{
struct virtio_softc *vsc = vq->vq_owner;
struct vioif_softc *sc = device_private(vsc->sc_child);
struct ifnet *ifp = &sc->sc_ethercom.ec_if;
int r = 0;
VIOIF_TX_LOCK(sc);
@ -1127,6 +1128,8 @@ vioif_tx_vq_done(struct virtqueue *vq)
out:
VIOIF_TX_UNLOCK(sc);
if (r)
vioif_start(ifp);
return r;
}