From 33da49cd2e2cab9dad56f106204f2a2ae62b26dd Mon Sep 17 00:00:00 2001 From: Ruslan Bukin Date: Wed, 29 May 2019 16:01:34 +0000 Subject: [PATCH] Don't copy the data from bounce buffer back to the mbuf if channel does not use bounce buffering. Sponsored by: DARPA, AFRL --- sys/dev/xdma/xdma_sg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/xdma/xdma_sg.c b/sys/dev/xdma/xdma_sg.c index a78ca5b8d2b..e6c593c7c47 100644 --- a/sys/dev/xdma/xdma_sg.c +++ b/sys/dev/xdma/xdma_sg.c @@ -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);