Source-Changes-HG archive

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

[src/netbsd-7]: src/sys/dev/ic Pull up following revision(s) (requested by jd...



details:   https://anonhg.NetBSD.org/src/rev/cf62f2b5576a
branches:  netbsd-7
changeset: 799915:cf62f2b5576a
user:      martin <martin%NetBSD.org@localhost>
date:      Sun May 22 10:24:50 2016 +0000

description:
Pull up following revision(s) (requested by jdc in ticket #1170):
        sys/dev/ic/gem.c: revision 1.105
PR kern/46083
Track the start of each packet, so that we set the "Start of Frame" bit in
all the relevant transmit descriptors when enqueing multiple packets.
Patch from Valery Ushakov, slightly modified by me to handle debug output.
Tested on macppc/6.x and sparc64/7.99.x.

diffstat:

 sys/dev/ic/gem.c |  18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diffs (62 lines):

diff -r ee1dc2f66fd8 -r cf62f2b5576a sys/dev/ic/gem.c
--- a/sys/dev/ic/gem.c  Wed May 18 09:22:11 2016 +0000
+++ b/sys/dev/ic/gem.c  Sun May 22 10:24:50 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gem.c,v 1.102 2014/08/10 16:44:35 tls Exp $ */
+/*     $NetBSD: gem.c,v 1.102.2.1 2016/05/22 10:24:50 martin Exp $ */
 
 /*
  *
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gem.c,v 1.102 2014/08/10 16:44:35 tls Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gem.c,v 1.102.2.1 2016/05/22 10:24:50 martin Exp $");
 
 #include "opt_inet.h"
 
@@ -1360,6 +1360,9 @@
        struct gem_txsoft *txs;
        bus_dmamap_t dmamap;
        int error, firsttx, nexttx = -1, lasttx = -1, ofree, seg;
+#ifdef GEM_DEBUG
+       int otxnext;
+#endif
        uint64_t flags = 0;
 
        if ((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) != IFF_RUNNING)
@@ -1370,10 +1373,12 @@
         * the first descriptor we'll use.
         */
        ofree = sc->sc_txfree;
-       firsttx = sc->sc_txnext;
+#ifdef GEM_DEBUG
+       otxnext = sc->sc_txnext;
+#endif
 
        DPRINTF(sc, ("%s: gem_start: txfree %d, txnext %d\n",
-           device_xname(sc->sc_dev), ofree, firsttx));
+           device_xname(sc->sc_dev), ofree, otxnext));
 
        /*
         * Loop through the send queue, setting up transmit descriptors
@@ -1478,7 +1483,8 @@
                /*
                 * Initialize the transmit descriptors.
                 */
-               for (nexttx = sc->sc_txnext, seg = 0;
+               firsttx = sc->sc_txnext;
+               for (nexttx = firsttx, seg = 0;
                     seg < dmamap->dm_nsegs;
                     seg++, nexttx = GEM_NEXTTX(nexttx)) {
 
@@ -1600,7 +1606,7 @@
 
        if (sc->sc_txfree != ofree) {
                DPRINTF(sc, ("%s: packets enqueued, IC on %d, OWN on %d\n",
-                   device_xname(sc->sc_dev), lasttx, firsttx));
+                   device_xname(sc->sc_dev), lasttx, otxnext));
                /*
                 * The entire packet chain is set up.
                 * Kick the transmitter.



Home | Main Index | Thread Index | Old Index