MCPcopy Create free account
hub / github.com/axboe/liburing / main

Function main

test/io_uring_passthrough.c:453–515  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

451}
452
453int main(int argc, char *argv[])
454{
455 int i, ret;
456 char *fname;
457
458 if (argc < 2)
459 return T_EXIT_SKIP;
460
461 fname = argv[1];
462 ret = nvme_get_info(fname);
463
464 if (ret)
465 return T_EXIT_SKIP;
466
467 vecs = t_malloc(BUFFERS * sizeof(struct iovec));
468 backing_vec = t_create_buffers(1, BUFFERS * BS);
469 /* Slice single large backing_vec into multiple smaller vecs */
470 for (int i = 0; i < BUFFERS; i++) {
471 vecs[i].iov_base = backing_vec[0].iov_base + i * BS;
472 vecs[i].iov_len = BS;
473 }
474 if (meta_size)
475 t_posix_memalign(&meta_mem, 0x1000,
476 meta_size * BUFFERS * (BS >> lba_shift));
477
478 for (i = 0; i < 64; i++) {
479 int read = (i & 1) != 0;
480 int sqthread = (i & 2) != 0;
481 int fixed = (i & 4) != 0;
482 int nonvec = (i & 8) != 0;
483 int hybrid = (i & 16) != 0;
484 int async = (i & 32) != 0;
485 int linked = (i & 64) != 0;
486
487 ret = test_io(fname, i, read, sqthread, fixed, nonvec, hybrid, async, linked);
488 if (no_pt)
489 break;
490 if (ret) {
491 fprintf(stderr, "test_io failed %d/%d/%d/%d/%d\n",
492 read, sqthread, fixed, nonvec, hybrid);
493 goto err;
494 }
495 }
496
497 if (no_pt)
498 return T_EXIT_SKIP;
499
500 ret = test_io_uring_submit_enters(fname);
501 if (ret == T_EXIT_FAIL) {
502 fprintf(stderr, "test_io_uring_submit_enters failed\n");
503 goto err;
504 }
505
506 ret = test_invalid_passthru_submit(fname);
507 if (ret) {
508 fprintf(stderr, "test_invalid_passthru_submit failed\n");
509 goto err;
510 }

Callers

nothing calls this directly

Calls 7

nvme_get_infoFunction · 0.85
t_mallocFunction · 0.85
t_create_buffersFunction · 0.85
t_posix_memalignFunction · 0.85
test_ioFunction · 0.70

Tested by

no test coverage detected