Lines Matching refs:io_test
84 struct nvme_io_test_internal *io_test = arg;
95 buf = malloc(io_test->size, M_NVME, M_WAITOK);
96 idx = atomic_fetchadd_int(&io_test->td_idx, 1);
97 dev = io_test->ns->cdev;
99 offset = idx * 2048ULL * nvme_ns_get_sector_size(io_test->ns);
105 bio->bio_cmd = (io_test->opc == NVME_OPC_READ) ?
111 bio->bio_bcount = io_test->size;
113 if (io_test->flags & NVME_TEST_FLAG_REFTHREAD) {
126 if (io_test->flags & NVME_TEST_FLAG_REFTHREAD) {
138 timevalsub(&t, &io_test->start);
140 if (t.tv_sec >= io_test->time)
143 offset += io_test->size;
144 if ((offset + io_test->size) > nvme_ns_get_size(io_test->ns))
148 io_test->io_completed[idx] = io_completed;
149 wakeup_one(io_test);
153 atomic_subtract_int(&io_test->td_active, 1);
200 struct nvme_io_test_internal *io_test = arg;
206 tth->ns = io_test->ns;
207 tth->opc = io_test->opc;
208 memcpy(&tth->start, &io_test->start, sizeof(tth->start));
209 tth->buf = malloc(io_test->size, M_NVME, M_WAITOK);
210 tth->size = io_test->size;
211 tth->time = io_test->time;
212 tth->idx = atomic_fetchadd_int(&io_test->td_idx, 1);
223 io_test->io_completed[tth->idx] = tth->io_completed;
224 wakeup_one(io_test);
229 atomic_subtract_int(&io_test->td_active, 1);
238 struct nvme_io_test *io_test;
243 io_test = (struct nvme_io_test *)arg;
245 if ((io_test->opc != NVME_OPC_READ) &&
246 (io_test->opc != NVME_OPC_WRITE))
249 if (io_test->size % nvme_ns_get_sector_size(ns))
254 io_test_internal->opc = io_test->opc;
256 io_test_internal->td_active = io_test->num_threads;
257 io_test_internal->time = io_test->time;
258 io_test_internal->size = io_test->size;
259 io_test_internal->flags = io_test->flags;
268 for (i = 0; i < io_test->num_threads; i++)
272 tsleep(io_test_internal, 0, "nvme_test", io_test->time * 2 * hz);
277 memcpy(io_test->io_completed, io_test_internal->io_completed,
278 sizeof(io_test->io_completed));