Lines Matching full:tx

83 ioat_test_transaction_destroy(struct test_transaction *tx)
88 if (tx->buf[i] != NULL) {
89 free(tx->buf[i], M_IOAT_TEST);
90 tx->buf[i] = NULL;
94 free(tx, M_IOAT_TEST);
101 struct test_transaction *tx;
104 tx = malloc(sizeof(*tx), M_IOAT_TEST, M_NOWAIT | M_ZERO);
105 if (tx == NULL)
108 tx->length = test->buffer_size;
112 tx->buf[i] = malloc(test->buffer_size, M_IOAT_TEST,
115 tx->buf[i] = contigmalloc(test->buffer_size,
119 if (tx->buf[i] == NULL) {
120 ioat_test_transaction_destroy(tx);
124 return (tx);
140 ioat_compare_ok(struct test_transaction *tx)
146 test = tx->test;
148 for (i = 0; i < tx->depth; i++) {
149 dst = tx->buf[2 * i + 1];
150 src = tx->buf[2 * i];
153 for (j = 0; j < tx->length; j += sizeof(uint64_t)) {
155 MIN(sizeof(uint64_t), tx->length - j))
160 if (memcmp(src, dst, tx->length) != 0)
165 dump_hex(dst, tx->length / 32);
174 struct test_transaction *tx;
180 tx = arg;
181 test = tx->test;
183 if (test->verify && !ioat_compare_ok(tx)) {
185 atomic_add_32(&test->status[IOAT_TEST_MISCOMPARE], tx->depth);
187 atomic_add_32(&test->status[IOAT_TEST_OK], tx->depth);
190 TAILQ_REMOVE(&test->pend_q, tx, entry);
191 TAILQ_INSERT_TAIL(&test->free_q, tx, entry);
200 struct test_transaction *tx;
203 tx = ioat_test_transaction_create(test, test->chain_depth * 2);
204 if (tx == NULL) {
205 ioat_test_log(0, "tx == NULL - memory exhausted\n");
210 TAILQ_INSERT_HEAD(&test->free_q, tx, entry);
212 tx->test = test;
213 tx->depth = test->chain_depth;
216 for (j = 0; j < (tx->length / sizeof(uint32_t)); j++) {
220 ((uint32_t *)tx->buf[2*k])[j] = ~val;
221 ((uint32_t *)tx->buf[2*k+1])[j] = val;
231 struct test_transaction *tx, *s;
233 TAILQ_FOREACH_SAFE(tx, &test->free_q, entry, s)
234 ioat_test_transaction_destroy(tx);
237 TAILQ_FOREACH_SAFE(tx, &test->pend_q, entry, s)
238 ioat_test_transaction_destroy(tx);
245 struct test_transaction *tx;
258 tx = TAILQ_FIRST(&test->free_q);
259 TAILQ_REMOVE(&test->free_q, tx, entry);
260 TAILQ_INSERT_HEAD(&test->pend_q, tx, entry);
265 for (i = 0; i < tx->depth; i++) {
267 memcpy(tx->buf[2 * i + 1], tx->buf[2 * i], tx->length);
268 if (i == tx->depth - 1)
269 ioat_dma_test_callback(tx, 0);
273 src = vtophys((vm_offset_t)tx->buf[2*i]);
274 dest = vtophys((vm_offset_t)tx->buf[2*i+1]);
283 if (i == tx->depth - 1) {
293 desc = ioat_copy(dma, dest, src, tx->length, cb, tx,
296 fillpattern = *(uint64_t *)tx->buf[2*i];
298 tx->length, cb, tx, flags);
302 src2 = vtophys((vm_offset_t)tx->buf[2*i] + PAGE_SIZE);
303 dst2 = vtophys((vm_offset_t)tx->buf[2*i+1] + PAGE_SIZE);
306 cb, tx, flags);
310 src2 = vtophys((vm_offset_t)tx->buf[2*i+1] + PAGE_SIZE);
311 dst2 = vtophys((vm_offset_t)tx->buf[2*i] + PAGE_SIZE);
314 cb, tx, flags);
318 tx->crc[i] = 0;
319 crc = vtophys((vm_offset_t)&tx->crc[i]);
320 desc = ioat_crc(dma, src, tx->length,
321 NULL, crc, cb, tx, flags | DMA_CRC_STORE);
325 tx->crc[i] = 0;
326 crc = vtophys((vm_offset_t)&tx->crc[i]);
327 desc = ioat_copy_crc(dma, dest, src, tx->length,
328 NULL, crc, cb, tx, flags | DMA_CRC_STORE);
342 if (desc == NULL && tx->depth > 0) {
343 atomic_add_32(&test->status[IOAT_TEST_NO_DMA_ENGINE], tx->depth);
345 TAILQ_REMOVE(&test->pend_q, tx, entry);
346 TAILQ_INSERT_HEAD(&test->free_q, tx, entry);