Lines Matching refs:tth
164 struct nvme_io_test_thread *tth = arg;
167 tth->io_completed++;
171 wakeup_one(tth);
176 timevalsub(&t, &tth->start);
178 if (t.tv_sec >= tth->time) {
179 wakeup_one(tth);
183 switch (tth->opc) {
185 nvme_ns_cmd_write(tth->ns, tth->buf, tth->idx * 2048,
186 tth->size/nvme_ns_get_sector_size(tth->ns),
187 nvme_ns_io_test_cb, tth);
190 nvme_ns_cmd_read(tth->ns, tth->buf, tth->idx * 2048,
191 tth->size/nvme_ns_get_sector_size(tth->ns),
192 nvme_ns_io_test_cb, tth);
203 struct nvme_io_test_thread *tth;
207 tth = malloc(sizeof(*tth), M_NVME, M_WAITOK | M_ZERO);
208 tth->ns = io_test->ns;
209 tth->opc = io_test->opc;
210 memcpy(&tth->start, &io_test->start, sizeof(tth->start));
211 tth->buf = malloc(io_test->size, M_NVME, M_WAITOK);
212 tth->size = io_test->size;
213 tth->time = io_test->time;
214 tth->idx = atomic_fetchadd_int(&io_test->td_idx, 1);
218 nvme_ns_io_test_cb(tth, &cpl);
220 error = tsleep(tth, 0, "test_wait", tth->time*hz*2);
225 io_test->io_completed[tth->idx] = tth->io_completed;
228 free(tth->buf, M_NVME);
229 free(tth, M_NVME);