Bug 53751 - bus_dma(9) incorrectly documents BUS_DMA_ALLOCNOW
Summary: bus_dma(9) incorrectly documents BUS_DMA_ALLOCNOW
Status: Open
Alias: None
Product: Documentation
Classification: Unclassified
Component: Manual Pages (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
Depends on:
Reported: 2003-06-26 09:30 UTC by Hartmut Brandt
Modified: 2021-01-17 00:18 UTC (History)
2 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Hartmut Brandt freebsd_committer 2003-06-26 09:30:09 UTC
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.


Either document a short version of the above or completly overhaul the bus dma
stuff :-)
Look at the code in i386/i386/busdma_machdep.c
Comment 1 Bruce M Simpson freebsd_committer 2004-07-03 07:42:17 UTC
Responsible Changed
From-To: freebsd-doc->hmp

This is hmp's manor
Comment 2 gnats freebsd_committer 2007-07-31 06:52:32 UTC
Responsible Changed
From-To: hmp->freebsd-doc
Comment 3 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:59:05 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped
Comment 4 PauAmma freebsd_triage 2021-01-17 00:18:41 UTC
Is this still applicable? That description now reads:

                              BUS_DMA_ALLOCNOW      Pre-allocate enough
                                                    resources to handle at
                                                    least one map load
                                                    operation on this tag.  If
                                                    sufficient resources are
                                                    not available, ENOMEM is
                                                    returned.  This should not
                                                    be used for tags that only
                                                    describe buffers that will
                                                    be allocated with
                                                    bus_dmamem_alloc().  Also,
                                                    due to resource sharing
                                                    with other tags, this flag
                                                    does not guarantee that
                                                    resources will be
                                                    allocated or reserved
                                                    exclusively for this tag.
                                                    It should be treated only
                                                    as a minor optimization.