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
Look at the code in i386/i386/busdma_machdep.c
This is hmp's manor
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
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
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.