Lines Matching refs:tx

86 ioat_test_transaction_destroy(struct test_transaction *tx)  in ioat_test_transaction_destroy()  argument
91 test = tx->test; in ioat_test_transaction_destroy()
94 if (tx->buf[i] != NULL) { in ioat_test_transaction_destroy()
96 free(tx->buf[i], M_IOAT_TEST); in ioat_test_transaction_destroy()
98 contigfree(tx->buf[i], tx->length, M_IOAT_TEST); in ioat_test_transaction_destroy()
99 tx->buf[i] = NULL; in ioat_test_transaction_destroy()
103 free(tx, M_IOAT_TEST); in ioat_test_transaction_destroy()
110 struct test_transaction *tx; in ioat_test_transaction_create() local
113 tx = malloc(sizeof(*tx), M_IOAT_TEST, M_NOWAIT | M_ZERO); in ioat_test_transaction_create()
114 if (tx == NULL) in ioat_test_transaction_create()
117 tx->length = test->buffer_size; in ioat_test_transaction_create()
121 tx->buf[i] = malloc(test->buffer_size, M_IOAT_TEST, in ioat_test_transaction_create()
124 tx->buf[i] = contigmalloc(test->buffer_size, in ioat_test_transaction_create()
128 if (tx->buf[i] == NULL) { in ioat_test_transaction_create()
129 ioat_test_transaction_destroy(tx); in ioat_test_transaction_create()
133 return (tx); in ioat_test_transaction_create()
149 ioat_compare_ok(struct test_transaction *tx) in ioat_compare_ok() argument
155 test = tx->test; in ioat_compare_ok()
157 for (i = 0; i < tx->depth; i++) { in ioat_compare_ok()
158 dst = tx->buf[2 * i + 1]; in ioat_compare_ok()
159 src = tx->buf[2 * i]; in ioat_compare_ok()
162 for (j = 0; j < tx->length; j += sizeof(uint64_t)) { in ioat_compare_ok()
164 MIN(sizeof(uint64_t), tx->length - j)) in ioat_compare_ok()
169 if (memcmp(src, dst, tx->length) != 0) in ioat_compare_ok()
174 dump_hex(dst, tx->length / 32); in ioat_compare_ok()
183 struct test_transaction *tx; in ioat_dma_test_callback() local
189 tx = arg; in ioat_dma_test_callback()
190 test = tx->test; in ioat_dma_test_callback()
192 if (test->verify && !ioat_compare_ok(tx)) { in ioat_dma_test_callback()
194 atomic_add_32(&test->status[IOAT_TEST_MISCOMPARE], tx->depth); in ioat_dma_test_callback()
196 atomic_add_32(&test->status[IOAT_TEST_OK], tx->depth); in ioat_dma_test_callback()
199 TAILQ_REMOVE(&test->pend_q, tx, entry); in ioat_dma_test_callback()
200 TAILQ_INSERT_TAIL(&test->free_q, tx, entry); in ioat_dma_test_callback()
209 struct test_transaction *tx; in ioat_test_prealloc_memory() local
212 tx = ioat_test_transaction_create(test, test->chain_depth * 2); in ioat_test_prealloc_memory()
213 if (tx == NULL) { in ioat_test_prealloc_memory()
219 TAILQ_INSERT_HEAD(&test->free_q, tx, entry); in ioat_test_prealloc_memory()
221 tx->test = test; in ioat_test_prealloc_memory()
222 tx->depth = test->chain_depth; in ioat_test_prealloc_memory()
225 for (j = 0; j < (tx->length / sizeof(uint32_t)); j++) { in ioat_test_prealloc_memory()
229 ((uint32_t *)tx->buf[2*k])[j] = ~val; in ioat_test_prealloc_memory()
230 ((uint32_t *)tx->buf[2*k+1])[j] = val; in ioat_test_prealloc_memory()
240 struct test_transaction *tx, *s; in ioat_test_release_memory() local
242 TAILQ_FOREACH_SAFE(tx, &test->free_q, entry, s) in ioat_test_release_memory()
243 ioat_test_transaction_destroy(tx); in ioat_test_release_memory()
246 TAILQ_FOREACH_SAFE(tx, &test->pend_q, entry, s) in ioat_test_release_memory()
247 ioat_test_transaction_destroy(tx); in ioat_test_release_memory()
254 struct test_transaction *tx; in ioat_test_submit_1_tx() local
267 tx = TAILQ_FIRST(&test->free_q); in ioat_test_submit_1_tx()
268 TAILQ_REMOVE(&test->free_q, tx, entry); in ioat_test_submit_1_tx()
269 TAILQ_INSERT_HEAD(&test->pend_q, tx, entry); in ioat_test_submit_1_tx()
274 for (i = 0; i < tx->depth; i++) { in ioat_test_submit_1_tx()
276 memcpy(tx->buf[2 * i + 1], tx->buf[2 * i], tx->length); in ioat_test_submit_1_tx()
277 if (i == tx->depth - 1) in ioat_test_submit_1_tx()
278 ioat_dma_test_callback(tx, 0); in ioat_test_submit_1_tx()
282 src = vtophys((vm_offset_t)tx->buf[2*i]); in ioat_test_submit_1_tx()
283 dest = vtophys((vm_offset_t)tx->buf[2*i+1]); in ioat_test_submit_1_tx()
292 if (i == tx->depth - 1) { in ioat_test_submit_1_tx()
302 desc = ioat_copy(dma, dest, src, tx->length, cb, tx, in ioat_test_submit_1_tx()
305 fillpattern = *(uint64_t *)tx->buf[2*i]; in ioat_test_submit_1_tx()
307 tx->length, cb, tx, flags); in ioat_test_submit_1_tx()
311 src2 = vtophys((vm_offset_t)tx->buf[2*i] + PAGE_SIZE); in ioat_test_submit_1_tx()
312 dst2 = vtophys((vm_offset_t)tx->buf[2*i+1] + PAGE_SIZE); in ioat_test_submit_1_tx()
315 cb, tx, flags); in ioat_test_submit_1_tx()
319 src2 = vtophys((vm_offset_t)tx->buf[2*i+1] + PAGE_SIZE); in ioat_test_submit_1_tx()
320 dst2 = vtophys((vm_offset_t)tx->buf[2*i] + PAGE_SIZE); in ioat_test_submit_1_tx()
323 cb, tx, flags); in ioat_test_submit_1_tx()
327 tx->crc[i] = 0; in ioat_test_submit_1_tx()
328 crc = vtophys((vm_offset_t)&tx->crc[i]); in ioat_test_submit_1_tx()
329 desc = ioat_crc(dma, src, tx->length, in ioat_test_submit_1_tx()
330 NULL, crc, cb, tx, flags | DMA_CRC_STORE); in ioat_test_submit_1_tx()
334 tx->crc[i] = 0; in ioat_test_submit_1_tx()
335 crc = vtophys((vm_offset_t)&tx->crc[i]); in ioat_test_submit_1_tx()
336 desc = ioat_copy_crc(dma, dest, src, tx->length, in ioat_test_submit_1_tx()
337 NULL, crc, cb, tx, flags | DMA_CRC_STORE); in ioat_test_submit_1_tx()
351 if (desc == NULL && tx->depth > 0) { in ioat_test_submit_1_tx()
352 atomic_add_32(&test->status[IOAT_TEST_NO_DMA_ENGINE], tx->depth); in ioat_test_submit_1_tx()
354 TAILQ_REMOVE(&test->pend_q, tx, entry); in ioat_test_submit_1_tx()
355 TAILQ_INSERT_HEAD(&test->free_q, tx, entry); in ioat_test_submit_1_tx()