summaryrefslogtreecommitdiffstats
path: root/dma/nwl_engine_buffers.h
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2015-05-06 05:46:01 +0200
committerSuren A. Chilingaryan <csa@suren.me>2015-05-06 05:46:01 +0200
commitb9a1af8a3b03a5e8575d87c3593a5931cd0e7a8c (patch)
treea0e73734d597ab1ab4a1d8a6393923d7e8b0914b /dma/nwl_engine_buffers.h
parent53582e958d727e06648743e505862f9df11bbb35 (diff)
downloadpcitool-b9a1af8a3b03a5e8575d87c3593a5931cd0e7a8c.tar.gz
pcitool-b9a1af8a3b03a5e8575d87c3593a5931cd0e7a8c.tar.bz2
pcitool-b9a1af8a3b03a5e8575d87c3593a5931cd0e7a8c.tar.xz
pcitool-b9a1af8a3b03a5e8575d87c3593a5931cd0e7a8c.zip
Add fields reporting consumed buffers and space to the dma_engine_status and provide better ipedma benchmarking
Diffstat (limited to 'dma/nwl_engine_buffers.h')
-rw-r--r--dma/nwl_engine_buffers.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/dma/nwl_engine_buffers.h b/dma/nwl_engine_buffers.h
index d3af079..ef1c74f 100644
--- a/dma/nwl_engine_buffers.h
+++ b/dma/nwl_engine_buffers.h
@@ -374,6 +374,8 @@ int dma_nwl_get_status(pcilib_dma_context_t *vctx, pcilib_dma_engine_t dma, pcil
status->ring_size = ectx->ring_size;
status->buffer_size = ectx->page_size;
status->ring_tail = ectx->tail;
+ status->written_buffers = 0;
+ status->written_bytes = 0;
if (ectx->desc->direction == PCILIB_DMA_FROM_DEVICE) {
size_t pos = 0;
@@ -402,7 +404,16 @@ int dma_nwl_get_status(pcilib_dma_context_t *vctx, pcilib_dma_engine_t dma, pcil
ring += PCILIB_NWL_DMA_DESCRIPTOR_SIZE;
}
+ }
+
+ for (i = 0; (i < ectx->ring_size)&&(i < n_buffers); i++) {
+ bstatus = NWL_RING_GET(ring, DMA_BD_BUFL_STATUS_OFFSET);
+ if (bstatus & DMA_BD_COMP_MASK) {
+ status->written_buffers++;
+ if ((bstatus & (DMA_BD_ERROR_MASK)) == 0)
+ status->written_bytes += bstatus & DMA_BD_BUFL_MASK;
+ }
}
-
+
return 0;
}