In _bus_dmamap_load_mbuf() ensure that for large mbuf m_len values
authorclaudio <claudio@openbsd.org>
Thu, 7 Mar 2024 15:01:53 +0000 (15:01 +0000)
committerclaudio <claudio@openbsd.org>
Thu, 7 Mar 2024 15:01:53 +0000 (15:01 +0000)
commitdeb7b0be1b2a387092b27c5263ee89d7ae4b91bc
tree73c6dd5498dde493dc6ef1c49e6666d64789cf69
parent72ae530b1ed9ee170ede8ceeb2fa8b907b7d680e
In _bus_dmamap_load_mbuf() ensure that for large mbuf m_len values
the incr value is rounded to the page boundary. This can happen when
m_defrag() packs a TSO packet into one big mbuf cluster.

Also fix _bus_dmamap_load_uio() which has the same min(buflen, NBPG); logic.
bus_dmamap_load_uio() is unsued and will be removed after unlock.
OK miod@ bluhm@ kettenis@
sys/arch/sparc64/sparc64/machdep.c