diff options
author | Suren A. Chilingaryan <csa@suren.me> | 2015-11-20 06:04:08 +0100 |
---|---|---|
committer | Suren A. Chilingaryan <csa@suren.me> | 2015-11-20 06:04:08 +0100 |
commit | 517ecf828e60e1e364c3ab6e67c2acd8a3c1b0c1 (patch) | |
tree | bc3349f5f682a578050150318f2500a6c8a7a63f /dma/ipe_benchmark.c | |
parent | 2bda41263f2464c271509b0bd9ea9062c239d851 (diff) | |
download | pcitool-517ecf828e60e1e364c3ab6e67c2acd8a3c1b0c1.tar.gz pcitool-517ecf828e60e1e364c3ab6e67c2acd8a3c1b0c1.tar.bz2 pcitool-517ecf828e60e1e364c3ab6e67c2acd8a3c1b0c1.tar.xz pcitool-517ecf828e60e1e364c3ab6e67c2acd8a3c1b0c1.zip |
Support large DMA pages in IPEDMA
Diffstat (limited to 'dma/ipe_benchmark.c')
-rw-r--r-- | dma/ipe_benchmark.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/dma/ipe_benchmark.c b/dma/ipe_benchmark.c index 57e5646..937a848 100644 --- a/dma/ipe_benchmark.c +++ b/dma/ipe_benchmark.c @@ -74,11 +74,12 @@ double dma_ipe_benchmark(pcilib_dma_context_t *vctx, pcilib_dma_engine_addr_t dm if ((dma != PCILIB_DMA_ENGINE_INVALID)&&(dma > 1)) return -1.; - if (size%IPEDMA_PAGE_SIZE) size = (1 + size / IPEDMA_PAGE_SIZE) * IPEDMA_PAGE_SIZE; - err = dma_ipe_start(vctx, 0, PCILIB_DMA_FLAGS_DEFAULT); if (err) return err; + if (size%ctx->page_size) size = (1 + size / ctx->page_size) * ctx->page_size; + + if (getenv("PCILIB_BENCHMARK_HARDWARE")) read_dma = dma_ipe_skim_dma_custom; else @@ -102,9 +103,9 @@ double dma_ipe_benchmark(pcilib_dma_context_t *vctx, pcilib_dma_engine_addr_t dm pcilib_calc_deadline(&start, ctx->dma_timeout * IPEDMA_DMA_PAGES); #ifdef IPEDMA_BUG_LAST_READ - dma_buffer_space = (IPEDMA_DMA_PAGES - 2) * IPEDMA_PAGE_SIZE; + dma_buffer_space = (IPEDMA_DMA_PAGES - 2) * ctx->page_size; #else /* IPEDMA_BUG_LAST_READ */ - dma_buffer_space = (IPEDMA_DMA_PAGES - 1) * IPEDMA_PAGE_SIZE; + dma_buffer_space = (IPEDMA_DMA_PAGES - 1) * ctx->page_size; #endif /* IPEDMA_BUG_LAST_READ */ // Allocate memory and prepare data |