From 517ecf828e60e1e364c3ab6e67c2acd8a3c1b0c1 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Fri, 20 Nov 2015 06:04:08 +0100 Subject: Support large DMA pages in IPEDMA --- dma/ipe_benchmark.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'dma/ipe_benchmark.c') 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 -- cgit v1.2.3