From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 4 12:34:14 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CC8C1065676 for ; Tue, 4 Nov 2008 12:34:14 +0000 (UTC) (envelope-from patfbsd@davenulle.org) Received: from smtp.lamaiziere.net (net.lamaiziere.net [91.121.44.19]) by mx1.freebsd.org (Postfix) with ESMTP id 206958FC1B for ; Tue, 4 Nov 2008 12:34:14 +0000 (UTC) (envelope-from patfbsd@davenulle.org) Received: from baby-jane.lamaiziere.net (136.10.87-79.rev.gaoland.net [79.87.10.136]) by smtp.lamaiziere.net (Postfix) with ESMTPA id 53750633679; Tue, 4 Nov 2008 13:34:12 +0100 (CET) Received: from baby-jane-lamaiziere-net.local (localhost [127.0.0.1]) by baby-jane.lamaiziere.net (Postfix) with ESMTP id 168DF6434B3; Tue, 4 Nov 2008 13:34:10 +0100 (CET) Date: Tue, 4 Nov 2008 13:34:08 +0100 From: Patrick =?ISO-8859-15?Q?Lamaizi=E8re?= To: John Baldwin 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> Organization: /dave/nulle X-Mailer: Claws Mail 3.3.1 (GTK+ 2.12.9; i386-apple-darwin9.3.0) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 8bit Cc: freebsd-hackers@freebsd.org Subject: Re: problem with bus_dmamap_load_uio X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2008 12:34:14 -0000 Le Mon, 3 Nov 2008 18:49:57 -0500, John Baldwin 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.