> From: David Gwynne <dlgwy...@gmail.com> > Date: Mon, 4 Apr 2011 05:59:20 +1000 > > On 04/04/2011, at 5:31 AM, Mark Kettenis wrote: > > >> Date: Sun, 3 Apr 2011 13:46:40 +0200 > >> From: Claudio Jeker <cje...@diehard.n-r-g.com> > >> > >> bce(4) was turned off because of limitations in the DMA engine that allows > >> the chip to access only 1G of memory. On systems with more then 1G of > >> memory hilarity ensued. > >> > >> Now I rewrote the driver to use bcopy() to copy the mbufs into a savely > >> allocated DMA memory buffer. So the chip will now work with any ammount of > >> memory in the machine. It works for me so if you own a bce(4) please test. > > > >> + /* Create the data DMA region and maps. */ > >> + if ((sc->bce_data = (caddr_t)uvm_km_kmemalloc_pla(kernel_map, > >> + uvm.kernel_object, (BCE_NTXDESC + BCE_NRXDESC) * MCLBYTES, 0, > >> + UVM_KMF_NOWAIT, 0, (paddr_t)(0x40000000 - 1), 0, 0, 1)) == NULL) { > >> + printf(": unable to alloc space for ring"); > >> + return; > > > > Sorry, but I think drivers should not call uvm memory allocations > > directly. Instead we should promote _bus_dmamem_alloc_range() found > > on i386 and amd64 to a first class citizen. > > i would like to see this in bus_dma too.
Oh, and it is actually perfectly acceptable to have this new function on amd64 and i386 only. We can add it to other architectures on an as-needed basis.