Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci Try to get more packets going if the transmit in...



details:   https://anonhg.NetBSD.org/src/rev/7f65b5fa404e
branches:  trunk
changeset: 345295:7f65b5fa404e
user:      pooka <pooka%NetBSD.org@localhost>
date:      Tue May 17 10:05:31 2016 +0000

description:
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

diffstat:

 sys/dev/pci/if_vioif.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (35 lines):

diff -r 92f5998b1990 -r 7f65b5fa404e sys/dev/pci/if_vioif.c
--- a/sys/dev/pci/if_vioif.c    Tue May 17 09:05:14 2016 +0000
+++ b/sys/dev/pci/if_vioif.c    Tue May 17 10:05:31 2016 +0000
@@ -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 @@
 {
        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 @@
 
 out:
        VIOIF_TX_UNLOCK(sc);
+       if (r)
+               vioif_start(ifp);
        return r;
 }
 



Home | Main Index | Thread Index | Old Index