aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ioat/ioat_test.c
diff options
context:
space:
mode:
authorConrad Meyer <cem@FreeBSD.org>2015-10-26 19:34:12 +0000
committerConrad Meyer <cem@FreeBSD.org>2015-10-26 19:34:12 +0000
commit2a4fd6b17a3ca38cb1f1cdc5154ba59c66199e38 (patch)
tree556d1a6d688264cbe1665811bb99876a56115293 /sys/dev/ioat/ioat_test.c
parent9e3bbf26a9a1fad9d718cd990fc7ac8401906c13 (diff)
downloadsrc-2a4fd6b17a3ca38cb1f1cdc5154ba59c66199e38.tar.gz
src-2a4fd6b17a3ca38cb1f1cdc5154ba59c66199e38.zip
ioat: Add support for Block Fill operations
The IOAT hardware supports writing a 64-bit pattern to some destination buffer. The same limitations on buffer length apply as for copy operations. Throughput is a bit higher (probably because fill does not have to spend bandwidth reading from a source in memory). Support for testing Block Fill has been added to ioatcontrol(8) and the ioat_test device. ioatcontrol(8) accepts the '-f' flag, which tests Block Fill. (If the flag is omitted, the tool tests copy by default.) The '-V' flag, in conjunction with '-f', verifies that buffers are filled in the expected pattern. Tested on: Broadwell DE (Xeon D-1500) Sponsored by: EMC / Isilon Storage Division
Notes
Notes: svn path=/head/; revision=290021
Diffstat (limited to 'sys/dev/ioat/ioat_test.c')
-rw-r--r--sys/dev/ioat/ioat_test.c41
1 files changed, 37 insertions, 4 deletions
diff --git a/sys/dev/ioat/ioat_test.c b/sys/dev/ioat/ioat_test.c
index 215b0363e429..3f88ed98a689 100644
--- a/sys/dev/ioat/ioat_test.c
+++ b/sys/dev/ioat/ioat_test.c
@@ -123,11 +123,26 @@ test_transaction *ioat_test_transaction_create(unsigned num_buffers,
static bool
ioat_compare_ok(struct test_transaction *tx)
{
- uint32_t i;
+ struct ioat_test *test;
+ char *dst, *src;
+ uint32_t i, j;
+
+ test = tx->test;
for (i = 0; i < tx->depth; i++) {
- if (memcmp(tx->buf[2*i], tx->buf[2*i+1], tx->length) != 0)
- return (false);
+ dst = tx->buf[2 * i + 1];
+ src = tx->buf[2 * i];
+
+ if (test->testkind == IOAT_TEST_FILL) {
+ for (j = 0; j < tx->length; j += sizeof(uint64_t)) {
+ if (memcmp(src, &dst[j],
+ MIN(sizeof(uint64_t), tx->length - j))
+ != 0)
+ return (false);
+ }
+ } else if (test->testkind == IOAT_TEST_DMA)
+ if (memcmp(src, dst, tx->length) != 0)
+ return (false);
}
return (true);
}
@@ -208,8 +223,11 @@ ioat_test_submit_1_tx(struct ioat_test *test, bus_dmaengine_t dma)
struct bus_dmadesc *desc;
bus_dmaengine_callback_t cb;
bus_addr_t src, dest;
+ uint64_t fillpattern;
uint32_t i, flags;
+ desc = NULL;
+
IT_LOCK();
while (TAILQ_EMPTY(&test->free_q))
msleep(&test->free_q, &ioat_test_lk, 0, "test_submit", 0);
@@ -232,7 +250,15 @@ ioat_test_submit_1_tx(struct ioat_test *test, bus_dmaengine_t dma)
flags = 0;
}
- desc = ioat_copy(dma, src, dest, tx->length, cb, tx, flags);
+ if (test->testkind == IOAT_TEST_DMA)
+ desc = ioat_copy(dma, dest, src, tx->length, cb, tx,
+ flags);
+ else if (test->testkind == IOAT_TEST_FILL) {
+ fillpattern = *(uint64_t *)tx->buf[2*i];
+ desc = ioat_blockfill(dma, dest, fillpattern,
+ tx->length, cb, tx, flags);
+ }
+
if (desc == NULL)
panic("Failed to allocate a ring slot "
"-- this shouldn't happen!");
@@ -279,6 +305,13 @@ ioat_dma_test(void *arg)
return;
}
+ if (test->testkind >= IOAT_NUM_TESTKINDS) {
+ ioat_test_log(0, "Invalid kind %u\n",
+ (unsigned)test->testkind);
+ test->status[IOAT_TEST_INVALID_INPUT]++;
+ return;
+ }
+
dmaengine = ioat_get_dmaengine(test->channel_index);
if (dmaengine == NULL) {
ioat_test_log(0, "Couldn't acquire dmaengine\n");