Date: Tue, 4 Nov 2008 13:34:08 +0100 From: Patrick =?ISO-8859-15?Q?Lamaizi=E8re?= <patfbsd@davenulle.org> To: John Baldwin <jhb@freebsd.org> Cc: freebsd-hackers@freebsd.org Subject: Re: problem with bus_dmamap_load_uio Message-ID: <20081104133408.7a010b63@baby-jane-lamaiziere-net.local> In-Reply-To: <200811031849.57232.jhb@freebsd.org> References: <20081103215021.0412b7b2@baby-jane-lamaiziere-net.local> <200811031849.57232.jhb@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Le Mon, 3 Nov 2008 18:49:57 -0500, John Baldwin <jhb@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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20081104133408.7a010b63>