Lines Matching defs:tth
162 struct nvme_io_test_thread *tth = arg;
165 tth->io_completed++;
169 wakeup_one(tth);
174 timevalsub(&t, &tth->start);
176 if (t.tv_sec >= tth->time) {
177 wakeup_one(tth);
181 switch (tth->opc) {
183 nvme_ns_cmd_write(tth->ns, tth->buf, tth->idx * 2048,
184 tth->size/nvme_ns_get_sector_size(tth->ns),
185 nvme_ns_io_test_cb, tth);
188 nvme_ns_cmd_read(tth->ns, tth->buf, tth->idx * 2048,
189 tth->size/nvme_ns_get_sector_size(tth->ns),
190 nvme_ns_io_test_cb, tth);
201 struct nvme_io_test_thread *tth;
205 tth = malloc(sizeof(*tth), M_NVME, M_WAITOK | M_ZERO);
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);
216 nvme_ns_io_test_cb(tth, &cpl);
218 error = tsleep(tth, 0, "test_wait", tth->time*hz*2);
223 io_test->io_completed[tth->idx] = tth->io_completed;
226 free(tth->buf, M_NVME);
227 free(tth, M_NVME);