Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic PR kern/46083



details:   https://anonhg.NetBSD.org/src/rev/34cd30275063
branches:  trunk
changeset: 345299:34cd30275063
user:      jdc <jdc%NetBSD.org@localhost>
date:      Tue May 17 14:44:53 2016 +0000

description:
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 2c29c852247a -r 34cd30275063 sys/dev/ic/gem.c
--- a/sys/dev/ic/gem.c  Tue May 17 14:00:09 2016 +0000
+++ b/sys/dev/ic/gem.c  Tue May 17 14:44:53 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gem.c,v 1.104 2016/02/09 08:32:10 ozaki-r Exp $ */
+/*     $NetBSD: gem.c,v 1.105 2016/05/17 14:44:53 jdc Exp $ */
 
 /*
  *
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gem.c,v 1.104 2016/02/09 08:32:10 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gem.c,v 1.105 2016/05/17 14:44:53 jdc Exp $");
 
 #include "opt_inet.h"
 
@@ -1362,6 +1362,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)
@@ -1372,10 +1375,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
@@ -1480,7 +1485,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)) {
 
@@ -1602,7 +1608,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