Don't copy the data from bounce buffer back to the mbuf if channel does

not use bounce buffering.

Sponsored by:	DARPA, AFRL
This commit is contained in:
Ruslan Bukin 2019-05-29 16:01:34 +00:00
parent 7b4ec8d2fc
commit 33da49cd2e

View file

@ -348,7 +348,8 @@ xchan_seg_done(xdma_channel_t *xchan,
BUS_DMASYNC_POSTREAD);
bus_dmamap_unload(xchan->dma_tag_bufs, b->map);
} else {
if (xr->req_type == XR_TYPE_MBUF &&
if ((xchan->caps & XCHAN_CAP_NOBUFS) == 0 &&
xr->req_type == XR_TYPE_MBUF &&
xr->direction == XDMA_DEV_TO_MEM)
m_copyback(xr->m, 0, st->transferred,
(void *)xr->buf.vaddr);