Lines Matching defs:io_test

86 	struct nvme_io_test_internal	*io_test = arg;
99 buf = malloc(io_test->size, M_NVME, M_WAITOK);
100 idx = atomic_fetchadd_int(&io_test->td_idx, 1);
101 dev = io_test->ns->cdev;
103 offset = idx * 2048 * nvme_ns_get_sector_size(io_test->ns);
110 bio->bio_cmd = (io_test->opc == NVME_OPC_READ) ?
116 bio->bio_bcount = io_test->size;
118 if (io_test->flags & NVME_TEST_FLAG_REFTHREAD) {
133 if (io_test->flags & NVME_TEST_FLAG_REFTHREAD) {
149 timevalsub(&t, &io_test->start);
151 if (t.tv_sec >= io_test->time)
154 offset += io_test->size;
155 if ((offset + io_test->size) > nvme_ns_get_size(io_test->ns))
159 io_test->io_completed[idx] = io_completed;
160 wakeup_one(io_test);
164 atomic_subtract_int(&io_test->td_active, 1);
215 struct nvme_io_test_internal *io_test = arg;
221 tth->ns = io_test->ns;
222 tth->opc = io_test->opc;
223 memcpy(&tth->start, &io_test->start, sizeof(tth->start));
224 tth->buf = malloc(io_test->size, M_NVME, M_WAITOK);
225 tth->size = io_test->size;
226 tth->time = io_test->time;
227 tth->idx = atomic_fetchadd_int(&io_test->td_idx, 1);
238 io_test->io_completed[tth->idx] = tth->io_completed;
239 wakeup_one(io_test);
244 atomic_subtract_int(&io_test->td_active, 1);
257 struct nvme_io_test *io_test;
262 io_test = (struct nvme_io_test *)arg;
264 if ((io_test->opc != NVME_OPC_READ) &&
265 (io_test->opc != NVME_OPC_WRITE))
268 if (io_test->size % nvme_ns_get_sector_size(ns))
273 io_test_internal->opc = io_test->opc;
275 io_test_internal->td_active = io_test->num_threads;
276 io_test_internal->time = io_test->time;
277 io_test_internal->size = io_test->size;
278 io_test_internal->flags = io_test->flags;
287 for (i = 0; i < io_test->num_threads; i++)
296 tsleep(io_test_internal, 0, "nvme_test", io_test->time * 2 * hz);
301 memcpy(io_test->io_completed, io_test_internal->io_completed,
302 sizeof(io_test->io_completed));