Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci * Increase the number of Tx job queue entries fr...



details:   https://anonhg.NetBSD.org/src/rev/e850a64a3b6e
branches:  trunk
changeset: 526704:e850a64a3b6e
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Thu May 09 01:00:12 2002 +0000

description:
* Increase the number of Tx job queue entries from 32 to 64.
* Garbage-collect some unused stuff.
* Make the Tx window slide along the Tx job queue space, not the
  Tx descriptor space.  We are more likely to run low on DMA maps
  than we are hardware descriptors.

diffstat:

 sys/dev/pci/if_wm.c |  24 ++++++------------------
 1 files changed, 6 insertions(+), 18 deletions(-)

diffs (79 lines):

diff -r 9b9ea4d7d2b0 -r e850a64a3b6e sys/dev/pci/if_wm.c
--- a/sys/dev/pci/if_wm.c       Thu May 09 00:58:45 2002 +0000
+++ b/sys/dev/pci/if_wm.c       Thu May 09 01:00:12 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_wm.c,v 1.8 2002/05/09 00:41:06 thorpej Exp $        */
+/*     $NetBSD: if_wm.c,v 1.9 2002/05/09 01:00:12 thorpej Exp $        */
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -114,12 +114,12 @@
  * Transmit descriptor list size.  Due to errata, we can only have
  * 256 hardware descriptors in the ring.  We tell the upper layers
  * that they can queue a lot of packets, and we go ahead and mange
- * up to 32 of them at a time.  We allow up to 16 DMA segments per
+ * up to 64 of them at a time.  We allow up to 16 DMA segments per
  * packet.
  */
 #define        WM_NTXSEGS              16
 #define        WM_IFQUEUELEN           256
-#define        WM_TXQUEUELEN           32
+#define        WM_TXQUEUELEN           64
 #define        WM_TXQUEUELEN_MASK      (WM_TXQUEUELEN - 1)
 #define        WM_NTXDESC              256
 #define        WM_NTXDESC_MASK         (WM_NTXDESC - 1)
@@ -127,15 +127,6 @@
 #define        WM_NEXTTXS(x)           (((x) + 1) & WM_TXQUEUELEN_MASK)
 
 /*
- * The interrupt mitigation feature of the Wiseman is pretty cool -- as
- * long as you're transmitting, you don't have to take an interrupt at
- * all.  However, we force an interrupt to happen every N + 1 packets
- * in order to kick us in a reasonable amount of time when we run out
- * of descriptors.
- */
-#define        WM_TXINTR_MASK          7
-
-/*
  * Receive descriptor list size.  We have one Rx buffer for normal
  * sized packets.  Jumbo packets consume 5 Rx buffers for a full-sized
  * packet.  We allocate 128 receive descriptors, each with a 2k
@@ -1022,7 +1013,6 @@
 
                sc->sc_txnext = WM_NEXTTX(sc->sc_txnext);
                txs->txs_ndesc++;
-               sc->sc_txwin++;
        }
 
        *cmdp = WTX_CMD_DEXT | WTC_DTYP_D;
@@ -1203,8 +1193,6 @@
                            cksumfields;
                        lasttx = nexttx;
 
-                       sc->sc_txwin++;
-
                        DPRINTF(WM_DEBUG_TX,
                            ("%s: TX: desc %d: low 0x%08x, len 0x%04x\n",
                            sc->sc_dev.dv_xname, nexttx,
@@ -1219,7 +1207,7 @@
                 */
                sc->sc_txdescs[lasttx].wtx_cmdlen |=
                    htole32(WTX_CMD_EOP | WTX_CMD_IFCS | WTX_CMD_RS);
-               if (sc->sc_txwin >= (WM_NTXDESC * 2 / 3)) {
+               if (++sc->sc_txwin >= (WM_TXQUEUELEN * 2 / 3)) {
                        WM_EVCNT_INCR(&sc->sc_ev_txforceintr);
                        sc->sc_txdescs[lasttx].wtx_cmdlen &=
                            htole32(~WTX_CMD_IDE);
@@ -1501,10 +1489,10 @@
         * If there are no more pending transmissions, cancel the watchdog
         * timer.
         */
-       if (sc->sc_txsfree == WM_TXQUEUELEN)
+       if (sc->sc_txsfree == WM_TXQUEUELEN) {
                ifp->if_timer = 0;
-       if (sc->sc_txfree == WM_NTXDESC)
                sc->sc_txwin = 0;
+       }
 }
 
 /*



Home | Main Index | Thread Index | Old Index