docs/53751: bus_dma(9) incorrectly documents BUS_DMA_ALLOCNOW

Hartmut Brandt harti at FreeBSD.org
Thu Jun 26 08:30:12 UTC 2003


>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 at 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:



More information about the freebsd-doc mailing list