Lines Matching refs:tth
162 struct nvme_io_test_thread *tth = arg; in nvme_ns_io_test_cb() local
165 tth->io_completed++; in nvme_ns_io_test_cb()
169 wakeup_one(tth); in nvme_ns_io_test_cb()
174 timevalsub(&t, &tth->start); in nvme_ns_io_test_cb()
176 if (t.tv_sec >= tth->time) { in nvme_ns_io_test_cb()
177 wakeup_one(tth); in nvme_ns_io_test_cb()
181 switch (tth->opc) { in nvme_ns_io_test_cb()
183 nvme_ns_cmd_write(tth->ns, tth->buf, tth->idx * 2048, in nvme_ns_io_test_cb()
184 tth->size/nvme_ns_get_sector_size(tth->ns), in nvme_ns_io_test_cb()
185 nvme_ns_io_test_cb, tth); in nvme_ns_io_test_cb()
188 nvme_ns_cmd_read(tth->ns, tth->buf, tth->idx * 2048, in nvme_ns_io_test_cb()
189 tth->size/nvme_ns_get_sector_size(tth->ns), in nvme_ns_io_test_cb()
190 nvme_ns_io_test_cb, tth); in nvme_ns_io_test_cb()
201 struct nvme_io_test_thread *tth; in nvme_ns_io_test() local
205 tth = malloc(sizeof(*tth), M_NVME, M_WAITOK | M_ZERO); in nvme_ns_io_test()
206 tth->ns = io_test->ns; in nvme_ns_io_test()
207 tth->opc = io_test->opc; in nvme_ns_io_test()
208 memcpy(&tth->start, &io_test->start, sizeof(tth->start)); in nvme_ns_io_test()
209 tth->buf = malloc(io_test->size, M_NVME, M_WAITOK); in nvme_ns_io_test()
210 tth->size = io_test->size; in nvme_ns_io_test()
211 tth->time = io_test->time; in nvme_ns_io_test()
212 tth->idx = atomic_fetchadd_int(&io_test->td_idx, 1); in nvme_ns_io_test()
216 nvme_ns_io_test_cb(tth, &cpl); in nvme_ns_io_test()
218 error = tsleep(tth, 0, "test_wait", tth->time*hz*2); in nvme_ns_io_test()
223 io_test->io_completed[tth->idx] = tth->io_completed; in nvme_ns_io_test()
226 free(tth->buf, M_NVME); in nvme_ns_io_test()
227 free(tth, M_NVME); in nvme_ns_io_test()