HomeFreeBSD

Fix BUS_DMA_MIN_ALLOC_COMP flag logic. When bus_dmamap_t map is being

Description

Fix BUS_DMA_MIN_ALLOC_COMP flag logic. When bus_dmamap_t map is being
created for bus_dma_tag_t tag, bounce pages should be allocated
only if needed.

Before the fix, they were allocated always if BUS_DMA_COULD_BOUNCE flag
was set but BUS_DMA_MIN_ALLOC_COMP not. As bounce pages are never freed,
it could cause memory exhaustion when a lot of such tags together with
their maps were created.

Note that there could be more maps in one tag by current design.
However BUS_DMA_MIN_ALLOC_COMP flag is tag's flag. It's set after
bounce pages are allocated. Thus, they are allocated only for first
tag's map which needs them.

Approved by: kib (mentor)

Details

Provenance
skraAuthored on
Parents
rS291141: Fix the handling of IPSec policies in the SCTP stack. At least
Branches
Unknown
Tags
Unknown