problem with bus_dmamap_load_uio
Patrick Lamaizière
patfbsd at davenulle.org
Tue Nov 4 04:34:14 PST 2008
Le Mon, 3 Nov 2008 18:49:57 -0500,
John Baldwin <jhb at freebsd.org> a écrit :
Hello,
> > I don't understand why bus_dmamap_load_uio() cannot load the uio.
> > Also when it fails, i copy the uio into a buffer and then a
> > bus_dmamap_load() of the buffer always works.
> >
> > The dma tag is allocated with:
> >
> > bus_dma_tag_create(bus_get_dma_tag(sc->sc_dev),/* parent */
> > 16, 0, /* alignments, bounds */
> > BUS_SPACE_MAXADDR_32BIT, /* lowaddr */
> > BUS_SPACE_MAXADDR, /* highaddr */
> > NULL, NULL, /* filter, filterarg */
> > 16384, /* maxsize */
> > 1, /* nsegments */
> > 16384, /* maxsegsize */
> > BUS_DMA_ALLOCNOW, /* flags */
> > NULL, NULL, /* lockfunc, lockarg */
> > &sc->sc_dmat);
...
> Your dma tag only allows a single scatter/gather entry (nsegments).
> What is happening is that under memory pressure, the virtual buffer
> in userland is not built from physically contiguous pages, so you
> would need multiple s/g entries to describe the buffer. Hence
> EFBIG.
Thank you John, you save me!
> If your hardware can handle multiple s/g entries, then just
> increase 'nsegments' and handle the multiple segments in your
> callback routine.
Unfortunely it does not.
Regards.
More information about the freebsd-hackers
mailing list