Lines Matching refs:tx

83 ioat_test_transaction_destroy(struct test_transaction *tx)
88 test = tx->test;
91 if (tx->buf[i] != NULL) {
93 free(tx->buf[i], M_IOAT_TEST);
95 contigfree(tx->buf[i], tx->length, M_IOAT_TEST);
96 tx->buf[i] = NULL;
100 free(tx, M_IOAT_TEST);
107 struct test_transaction *tx;
110 tx = malloc(sizeof(*tx), M_IOAT_TEST, M_NOWAIT | M_ZERO);
111 if (tx == NULL)
114 tx->length = test->buffer_size;
118 tx->buf[i] = malloc(test->buffer_size, M_IOAT_TEST,
121 tx->buf[i] = contigmalloc(test->buffer_size,
125 if (tx->buf[i] == NULL) {
126 ioat_test_transaction_destroy(tx);
130 return (tx);
146 ioat_compare_ok(struct test_transaction *tx)
152 test = tx->test;
154 for (i = 0; i < tx->depth; i++) {
155 dst = tx->buf[2 * i + 1];
156 src = tx->buf[2 * i];
159 for (j = 0; j < tx->length; j += sizeof(uint64_t)) {
161 MIN(sizeof(uint64_t), tx->length - j))
166 if (memcmp(src, dst, tx->length) != 0)
171 dump_hex(dst, tx->length / 32);
180 struct test_transaction *tx;
186 tx = arg;
187 test = tx->test;
189 if (test->verify && !ioat_compare_ok(tx)) {
191 atomic_add_32(&test->status[IOAT_TEST_MISCOMPARE], tx->depth);
193 atomic_add_32(&test->status[IOAT_TEST_OK], tx->depth);
196 TAILQ_REMOVE(&test->pend_q, tx, entry);
197 TAILQ_INSERT_TAIL(&test->free_q, tx, entry);
206 struct test_transaction *tx;
209 tx = ioat_test_transaction_create(test, test->chain_depth * 2);
210 if (tx == NULL) {
211 ioat_test_log(0, "tx == NULL - memory exhausted\n");
216 TAILQ_INSERT_HEAD(&test->free_q, tx, entry);
218 tx->test = test;
219 tx->depth = test->chain_depth;
222 for (j = 0; j < (tx->length / sizeof(uint32_t)); j++) {
226 ((uint32_t *)tx->buf[2*k])[j] = ~val;
227 ((uint32_t *)tx->buf[2*k+1])[j] = val;
237 struct test_transaction *tx, *s;
239 TAILQ_FOREACH_SAFE(tx, &test->free_q, entry, s)
240 ioat_test_transaction_destroy(tx);
243 TAILQ_FOREACH_SAFE(tx, &test->pend_q, entry, s)
244 ioat_test_transaction_destroy(tx);
251 struct test_transaction *tx;
264 tx = TAILQ_FIRST(&test->free_q);
265 TAILQ_REMOVE(&test->free_q, tx, entry);
266 TAILQ_INSERT_HEAD(&test->pend_q, tx, entry);
271 for (i = 0; i < tx->depth; i++) {
273 memcpy(tx->buf[2 * i + 1], tx->buf[2 * i], tx->length);
274 if (i == tx->depth - 1)
275 ioat_dma_test_callback(tx, 0);
279 src = vtophys((vm_offset_t)tx->buf[2*i]);
280 dest = vtophys((vm_offset_t)tx->buf[2*i+1]);
289 if (i == tx->depth - 1) {
299 desc = ioat_copy(dma, dest, src, tx->length, cb, tx,
302 fillpattern = *(uint64_t *)tx->buf[2*i];
304 tx->length, cb, tx, flags);
308 src2 = vtophys((vm_offset_t)tx->buf[2*i] + PAGE_SIZE);
309 dst2 = vtophys((vm_offset_t)tx->buf[2*i+1] + PAGE_SIZE);
312 cb, tx, flags);
316 src2 = vtophys((vm_offset_t)tx->buf[2*i+1] + PAGE_SIZE);
317 dst2 = vtophys((vm_offset_t)tx->buf[2*i] + PAGE_SIZE);
320 cb, tx, flags);
324 tx->crc[i] = 0;
325 crc = vtophys((vm_offset_t)&tx->crc[i]);
326 desc = ioat_crc(dma, src, tx->length,
327 NULL, crc, cb, tx, flags | DMA_CRC_STORE);
331 tx->crc[i] = 0;
332 crc = vtophys((vm_offset_t)&tx->crc[i]);
333 desc = ioat_copy_crc(dma, dest, src, tx->length,
334 NULL, crc, cb, tx, flags | DMA_CRC_STORE);
348 if (desc == NULL && tx->depth > 0) {
349 atomic_add_32(&test->status[IOAT_TEST_NO_DMA_ENGINE], tx->depth);
351 TAILQ_REMOVE(&test->pend_q, tx, entry);
352 TAILQ_INSERT_HEAD(&test->free_q, tx, entry);