Module Name:    src
Committed By:   pooka
Date:           Tue May 17 10:05:31 UTC 2016

Modified Files:
        src/sys/dev/pci: if_vioif.c

Log Message:
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


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/pci/if_vioif.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_vioif.c
diff -u src/sys/dev/pci/if_vioif.c:1.22 src/sys/dev/pci/if_vioif.c:1.23
--- src/sys/dev/pci/if_vioif.c:1.22	Tue Feb  9 08:32:11 2016
+++ src/sys/dev/pci/if_vioif.c	Tue May 17 10:05:31 2016
@@ -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;
 }
 

Reply via email to