Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci - Use the 64-bit PCI DMA tag if available.



details:   https://anonhg.NetBSD.org/src/rev/3969f250e8e5
branches:  trunk
changeset: 969765:3969f250e8e5
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sun Mar 01 03:00:31 2020 +0000

description:
- Use the 64-bit PCI DMA tag if available.
- Add a comment explaining that if we were to use more than one
  Rx ring / Rx Return ring, all of the Rx-related control data
  would need to be in the same 4G segment.

diffstat:

 sys/dev/pci/if_alc.c |  15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diffs (39 lines):

diff -r 2f69cbeb18c7 -r 3969f250e8e5 sys/dev/pci/if_alc.c
--- a/sys/dev/pci/if_alc.c      Sun Mar 01 02:51:42 2020 +0000
+++ b/sys/dev/pci/if_alc.c      Sun Mar 01 03:00:31 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_alc.c,v 1.50 2020/03/01 02:28:14 thorpej Exp $      */
+/*     $NetBSD: if_alc.c,v 1.51 2020/03/01 03:00:31 thorpej Exp $      */
 /*     $OpenBSD: if_alc.c,v 1.1 2009/08/08 09:31:13 kevlo Exp $        */
 /*-
  * Copyright (c) 2009, Pyun YongHyeon <yongari%FreeBSD.org@localhost>
@@ -1277,10 +1277,14 @@
        aprint_normal(": %s\n", sc->alc_ident->name);
 
        sc->sc_dev = self;
-       sc->sc_dmat = pa->pa_dmat;
        sc->sc_pct = pa->pa_pc;
        sc->sc_pcitag = pa->pa_tag;
 
+       if (pci_dma64_available(pa))
+               sc->sc_dmat = pa->pa_dmat64;
+       else
+               sc->sc_dmat = pa->pa_dmat;
+
        /*
         * Allocate IO memory
         */
@@ -1610,6 +1614,13 @@
            sc->alc_cdata.alc_tx_ring_map->dm_segs[0].ds_addr;
 
        /*
+        * NOTE: If we used more than one Rx / Rx Return ring,
+        * we would need to ensure ALL of the Rx-related stuff
+        * ended up in the same 4G segment, since the hardware
+        * requires this.
+        */
+
+       /*
         * Create DMA stuffs for RX ring
         */
        error = bus_dmamap_create(sc->sc_dmat, ALC_RX_RING_SZ, 1,



Home | Main Index | Thread Index | Old Index