Date: Thu, 26 Jun 2003 10:30:03 +0200 (CEST) From: Hartmut Brandt <harti@FreeBSD.org> To: FreeBSD-gnats-submit@FreeBSD.org Subject: docs/53751: bus_dma(9) incorrectly documents BUS_DMA_ALLOCNOW Message-ID: <200306260830.h5Q8U397074555@beagle.fokus.fraunhofer.de> Resent-Message-ID: <200306260830.h5Q8U9TI040536@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 53751 >Category: docs >Synopsis: bus_dma(9) incorrectly documents BUS_DMA_ALLOCNOW >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-doc >State: open >Quarter: >Keywords: >Date-Required: >Class: doc-bug >Submitter-Id: current-users >Arrival-Date: Thu Jun 26 01:30:09 PDT 2003 >Closed-Date: >Last-Modified: >Originator: Hartmut Brandt >Release: FreeBSD 5.1-CURRENT i386 >Organization: Fraunhofer Fokus >Environment: System: FreeBSD beagle.fokus.fraunhofer.de 5.1-CURRENT FreeBSD 5.1-CURRENT #7: Thu Jun 19 12:19:27 CEST 2003 hbb@beagle.fokus.fraunhofer.de:/opt/obj/usr/src/sys/BEAGLE i386 >Description: The explanaition of the BUS_DMA_ALLOCNOW flag to bus_dma_tag_create is correct only if that tag is used for just one map. This is because bus_dma_tag_create tries to allocate bounce pages based only on the size of the desired mapping. It cannot now how many maps will be created using that tag. One example where it doesn't work are network drivers which will use on tag to map all the receive or transmit buffers. Each mapped buffer may require its own bounce buffer, but tag_create has allocated only space for one map. Therefor bus_dmamap_load_mbuf will return either EINPROGRESS (if called without BUS_DMA_NOWAIT) or ENOMEM when it fails to allocate bounce buffers. >How-To-Repeat: Look at the code in i386/i386/busdma_machdep.c >Fix: Either document a short version of the above or completly overhaul the bus dma stuff :-) >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200306260830.h5Q8U397074555>