Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci * After testing for DD on a descriptor, and find...



details:   https://anonhg.NetBSD.org/src/rev/da86a0e2d32c
branches:  trunk
changeset: 535410:da86a0e2d32c
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sat Aug 17 20:58:04 2002 +0000

description:
* After testing for DD on a descriptor, and finding it clear,
  sync that descriptor with PREREAD to make sure that it is evicted
  from the data cache.  From Allen Briggs.
* With the above bug fixed, stop using BUS_DMA_COHERENT, resulting in
  a fairly decent performance improvement on systems where BUS_DMA_COHERENT
  causes descriptors to be accessed uncached (most painful in wm_start()).

diffstat:

 sys/dev/pci/if_wm.c |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diffs (39 lines):

diff -r fdedc85dcf98 -r da86a0e2d32c sys/dev/pci/if_wm.c
--- a/sys/dev/pci/if_wm.c       Sat Aug 17 20:46:26 2002 +0000
+++ b/sys/dev/pci/if_wm.c       Sat Aug 17 20:58:04 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_wm.c,v 1.19 2002/08/15 18:35:25 thorpej Exp $       */
+/*     $NetBSD: if_wm.c,v 1.20 2002/08/17 20:58:04 thorpej Exp $       */
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -677,7 +677,7 @@
 
        if ((error = bus_dmamem_map(sc->sc_dmat, &seg, rseg,
            sizeof(struct wm_control_data), (caddr_t *)&sc->sc_control_data,
-           BUS_DMA_COHERENT)) != 0) {
+           0)) != 0) {
                printf("%s: unable to map control data, error = %d\n",
                    sc->sc_dev.dv_xname, error);
                goto fail_1;
@@ -1504,8 +1504,11 @@
 
                status = le32toh(sc->sc_txdescs[
                    txs->txs_lastdesc].wtx_fields.wtxu_bits);
-               if ((status & WTX_ST_DD) == 0)
+               if ((status & WTX_ST_DD) == 0) {
+                       WM_CDTXSYNC(sc, txs->txs_lastdesc, 1,
+                           BUS_DMASYNC_PREREAD);
                        break;
+               }
 
                DPRINTF(WM_DEBUG_TX,
                    ("%s: TX: job %d done: descs %d..%d\n",
@@ -1588,6 +1591,7 @@
                        /*
                         * We have processed all of the receive descriptors.
                         */
+                       WM_CDRXSYNC(sc, i, BUS_DMASYNC_PREREAD);
                        break;
                }
 



Home | Main Index | Thread Index | Old Index