Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/isa Move tx chain result handling into iystart(). Th...



details:   https://anonhg.NetBSD.org/src/rev/5f235b04ad17
branches:  trunk
changeset: 507492:5f235b04ad17
user:      is <is%NetBSD.org@localhost>
date:      Fri Mar 23 13:15:27 2001 +0000

description:
Move tx chain result handling into iystart(). This way, ww normally only
need an interupt when the hardware hits tx chain end. We switch on one
int per packet sent when we fill up and go into OACTIVE mode.
Measured total interupt savings on large NFS writes: 20%.

diffstat:

 sys/dev/isa/if_iy.c |  41 ++++++++++++++++++++++++++++++++---------
 1 files changed, 32 insertions(+), 9 deletions(-)

diffs (110 lines):

diff -r e49bde69a793 -r 5f235b04ad17 sys/dev/isa/if_iy.c
--- a/sys/dev/isa/if_iy.c       Fri Mar 23 12:15:34 2001 +0000
+++ b/sys/dev/isa/if_iy.c       Fri Mar 23 13:15:27 2001 +0000
@@ -1,9 +1,9 @@
-/*     $NetBSD: if_iy.c,v 1.51 2001/03/22 14:30:47 is Exp $    */
+/*     $NetBSD: if_iy.c,v 1.52 2001/03/23 13:15:27 is Exp $    */
 /* #define IYDEBUG */
 /* #define IYMEMDEBUG */
 
 /*-
- * Copyright (c) 1996 The NetBSD Foundation, Inc.
+ * Copyright (c) 1996,2001 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -636,6 +636,7 @@
        u_int llen, residual;
        int avail;
        caddr_t data;
+       unsigned temp;
        u_int16_t resval, stat;
        bus_space_tag_t iot;
        bus_space_handle_t ioh;
@@ -648,6 +649,8 @@
        if ((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) != IFF_RUNNING)
                 return;
 
+       iy_intr_tx(sc);
+
        iot = sc->sc_iot;
        ioh = sc->sc_ioh;
 
@@ -706,7 +709,18 @@
                        printf("%s: len = %d, avail = %d, setting OACTIVE\n",
                            sc->sc_dev.dv_xname, len, avail);
 #endif
+                       /* mark interface as full ... */
                        ifp->if_flags |= IFF_OACTIVE;
+
+                       /* and wait for any transmission result */
+                       bus_space_write_1(iot, ioh, 0, BANK_SEL(2));
+
+                       temp = bus_space_read_1(iot, ioh, REG1);
+                       bus_space_write_1(iot, ioh, REG1,
+                               temp & ~XMT_CHAIN_INT);
+
+                       bus_space_write_1(iot, ioh, 0, BANK_SEL(0));
+
                        return;
                }
        
@@ -829,6 +843,13 @@
                sc->tx_last = last;
                sc->tx_end = end;
        }
+       /* and wait only for end of transmission chain */
+       bus_space_write_1(iot, ioh, 0, BANK_SEL(2));
+
+       temp = bus_space_read_1(iot, ioh, REG1);
+       bus_space_write_1(iot, ioh, REG1, temp | XMT_CHAIN_INT);
+
+       bus_space_write_1(iot, ioh, 0, BANK_SEL(0));
 }
 
 
@@ -924,15 +945,19 @@
 iyintr(arg)
        void *arg;
 {
-       struct iy_softc *sc = arg;
+       struct iy_softc *sc;
+       struct ifnet *ifp;
        bus_space_tag_t iot;
        bus_space_handle_t ioh;
 
        u_short status;
 
+       sc = arg;
        iot = sc->sc_iot;
        ioh = sc->sc_ioh;
 
+       ifp = &sc->sc_ethercom.ec_if;
+
        status = bus_space_read_1(iot, ioh, STATUS_REG);
 #ifdef IYDEBUG
        if (status & ALL_INTS) {
@@ -958,7 +983,10 @@
                bus_space_write_1(iot, ioh, STATUS_REG, RX_INT);
        }
        if (status & TX_INT) {
-               iy_intr_tx(sc);
+               /* Tell feeders we may be able to accept more data... */
+               ifp->if_flags &= ~IFF_OACTIVE;
+               /* and get more data. */
+               iystart(ifp);
                bus_space_write_1(iot, ioh, STATUS_REG, TX_INT);
        }
 
@@ -1143,11 +1171,6 @@
                if ((txstat2 & 0x2000) == 0)
                        ++ifp->if_oerrors;
        }
-       /* Nearly done. Tell feeders we may be able to accept more data... */
-       ifp->if_flags &= ~IFF_OACTIVE;
-
-       /* and get more data. */
-       iystart(ifp);
 }
 
 int



Home | Main Index | Thread Index | Old Index