History log of /haiku/src/libs/compat/freebsd_network/compat/vm/vm_extern.h
Revision Date Author Comments
# d66ceb73 02-Jun-2022 Augustin Cavalier <waddlesplash@gmail.com>

freebsd_network: Implement bouncing and address validation in bus_dma.

This has been missing since the rewrite in 26b95c15f255904694ce8224b6f21f0b931a9cff.

Until now it seems to not have been a problem since buffer sizes
were generally small enough and did not cross page boundaries due
to alignment guarantees. However, now that we have enabled jumbo
frames by default, some drivers do hit DMA limits without bouncing,
as these frames cross pages.

So, now we implement a basic bouncing system. Unlike FreeBSD which
maintains a global "bounce pages" cache that it pulls from,
we use per-dmamap bounce buffers, lazily allocated only if needed.
I tested this by forcing all non-"prohibited" dmamaps to bounce all
transactions, and the rtl81xx driver still worked that way (though
not all drivers may as they have expectations about contiguously
allocated memory never getting bounced.)

This should fix #17763. Hopefully it will also fix #17766 as well.