Commit e3b9c347 authored by Dan Williams's avatar Dan Williams

dmatest: add support for skipping verification and random data setup

Towards enabling dmatest to checkout performance add a 'noverify' mode.
Acked-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent be9fa5a4
...@@ -66,6 +66,10 @@ module_param(timeout, uint, S_IRUGO | S_IWUSR); ...@@ -66,6 +66,10 @@ module_param(timeout, uint, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(timeout, "Transfer Timeout in msec (default: 3000), " MODULE_PARM_DESC(timeout, "Transfer Timeout in msec (default: 3000), "
"Pass -1 for infinite timeout"); "Pass -1 for infinite timeout");
static bool noverify;
module_param(noverify, bool, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(noverify, "Disable random data setup and verification");
/** /**
* struct dmatest_params - test parameters. * struct dmatest_params - test parameters.
* @buf_size: size of the memcpy test buffer * @buf_size: size of the memcpy test buffer
...@@ -88,6 +92,7 @@ struct dmatest_params { ...@@ -88,6 +92,7 @@ struct dmatest_params {
unsigned int xor_sources; unsigned int xor_sources;
unsigned int pq_sources; unsigned int pq_sources;
int timeout; int timeout;
bool noverify;
}; };
/** /**
...@@ -435,18 +440,30 @@ static int dmatest_func(void *data) ...@@ -435,18 +440,30 @@ static int dmatest_func(void *data)
break; break;
} }
len = dmatest_random() % params->buf_size + 1; if (params->noverify) {
len = params->buf_size;
src_off = 0;
dst_off = 0;
} else {
len = dmatest_random() % params->buf_size + 1;
len = (len >> align) << align;
if (!len)
len = 1 << align;
src_off = dmatest_random() % (params->buf_size - len + 1);
dst_off = dmatest_random() % (params->buf_size - len + 1);
src_off = (src_off >> align) << align;
dst_off = (dst_off >> align) << align;
dmatest_init_srcs(thread->srcs, src_off, len,
params->buf_size);
dmatest_init_dsts(thread->dsts, dst_off, len,
params->buf_size);
}
len = (len >> align) << align; len = (len >> align) << align;
if (!len) if (!len)
len = 1 << align; len = 1 << align;
src_off = dmatest_random() % (params->buf_size - len + 1);
dst_off = dmatest_random() % (params->buf_size - len + 1);
src_off = (src_off >> align) << align;
dst_off = (dst_off >> align) << align;
dmatest_init_srcs(thread->srcs, src_off, len, params->buf_size);
dmatest_init_dsts(thread->dsts, dst_off, len, params->buf_size);
for (i = 0; i < src_cnt; i++) { for (i = 0; i < src_cnt; i++) {
u8 *buf = thread->srcs[i] + src_off; u8 *buf = thread->srcs[i] + src_off;
...@@ -555,10 +572,14 @@ static int dmatest_func(void *data) ...@@ -555,10 +572,14 @@ static int dmatest_func(void *data)
unmap_src(dev->dev, dma_srcs, len, src_cnt); unmap_src(dev->dev, dma_srcs, len, src_cnt);
unmap_dst(dev->dev, dma_dsts, params->buf_size, dst_cnt); unmap_dst(dev->dev, dma_dsts, params->buf_size, dst_cnt);
error_count = 0; if (params->noverify) {
dbg_result("test passed", total_tests, src_off, dst_off,
len, 0);
continue;
}
pr_debug("%s: verifying source buffer...\n", current->comm); pr_debug("%s: verifying source buffer...\n", current->comm);
error_count += dmatest_verify(thread->srcs, 0, src_off, error_count = dmatest_verify(thread->srcs, 0, src_off,
0, PATTERN_SRC, true); 0, PATTERN_SRC, true);
error_count += dmatest_verify(thread->srcs, src_off, error_count += dmatest_verify(thread->srcs, src_off,
src_off + len, src_off, src_off + len, src_off,
...@@ -773,6 +794,7 @@ static void run_threaded_test(struct dmatest_info *info) ...@@ -773,6 +794,7 @@ static void run_threaded_test(struct dmatest_info *info)
params->xor_sources = xor_sources; params->xor_sources = xor_sources;
params->pq_sources = pq_sources; params->pq_sources = pq_sources;
params->timeout = timeout; params->timeout = timeout;
params->noverify = noverify;
request_channels(info, DMA_MEMCPY); request_channels(info, DMA_MEMCPY);
request_channels(info, DMA_XOR); request_channels(info, DMA_XOR);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment