Lines Matching refs:opts

53 static void print_opts(raidz_test_opts_t *opts, boolean_t force)  in print_opts()  argument
56 switch (opts->rto_v) { in print_opts()
68 if (force || opts->rto_v >= D_INFO) { in print_opts()
76 opts->rto_ashift, /* -a */ in print_opts()
77 ilog2(opts->rto_offset), /* -o */ in print_opts()
78 opts->rto_dcols, /* -d */ in print_opts()
79 ilog2(opts->rto_dsize), /* -s */ in print_opts()
80 opts->rto_sweep ? "yes" : "no", /* -S */ in print_opts()
181 cmp_code(raidz_test_opts_t *opts, const raidz_map_t *rm, const int parity) in cmp_code() argument
188 if (abd_cmp(CODE_COL(rm, i), CODE_COL(opts->rm_golden, i), in cmp_code()
191 LOG_OPT(D_DEBUG, opts, in cmp_code()
199 cmp_data(raidz_test_opts_t *opts, raidz_map_t *rm) in cmp_data() argument
202 int dcols = opts->rm_golden->rm_cols - raidz_parity(opts->rm_golden); in cmp_data()
205 if (abd_cmp(DATA_COL(opts->rm_golden, i), DATA_COL(rm, i), in cmp_data()
206 DATA_COL(opts->rm_golden, i)->abd_size) != 0) { in cmp_data()
209 LOG_OPT(D_DEBUG, opts, in cmp_data()
259 init_raidz_golden_map(raidz_test_opts_t *opts, const int parity) in init_raidz_golden_map() argument
264 const size_t total_ncols = opts->rto_dcols + parity; in init_raidz_golden_map()
266 if (opts->rm_golden) { in init_raidz_golden_map()
267 fini_raidz_map(&opts->zio_golden, &opts->rm_golden); in init_raidz_golden_map()
270 opts->zio_golden = umem_zalloc(sizeof (zio_t), UMEM_NOFAIL); in init_raidz_golden_map()
273 opts->zio_golden->io_offset = zio_test->io_offset = opts->rto_offset; in init_raidz_golden_map()
274 opts->zio_golden->io_size = zio_test->io_size = opts->rto_dsize; in init_raidz_golden_map()
276 opts->zio_golden->io_abd = raidz_alloc(opts->rto_dsize); in init_raidz_golden_map()
277 zio_test->io_abd = raidz_alloc(opts->rto_dsize); in init_raidz_golden_map()
279 init_zio_abd(opts->zio_golden); in init_raidz_golden_map()
284 opts->rm_golden = vdev_raidz_map_alloc(opts->zio_golden, in init_raidz_golden_map()
285 opts->rto_ashift, total_ncols, parity); in init_raidz_golden_map()
287 opts->rto_ashift, total_ncols, parity); in init_raidz_golden_map()
289 VERIFY(opts->zio_golden); in init_raidz_golden_map()
290 VERIFY(opts->rm_golden); in init_raidz_golden_map()
292 vdev_raidz_generate_parity(opts->rm_golden); in init_raidz_golden_map()
296 err |= cmp_data(opts, rm_test); in init_raidz_golden_map()
297 err |= cmp_code(opts, rm_test, parity); in init_raidz_golden_map()
309 init_raidz_map(raidz_test_opts_t *opts, zio_t **zio, const int parity) in init_raidz_map() argument
312 const size_t alloc_dsize = opts->rto_dsize; in init_raidz_map()
313 const size_t total_ncols = opts->rto_dcols + parity; in init_raidz_map()
326 rm = vdev_raidz_map_alloc(*zio, opts->rto_ashift, in init_raidz_map()
337 run_gen_check(raidz_test_opts_t *opts) in run_gen_check() argument
344 err = init_raidz_golden_map(opts, PARITY_PQR); in run_gen_check()
371 rm_test = init_raidz_map(opts, &zio_test, fn+1); in run_gen_check()
377 if (!opts->rto_sanity) in run_gen_check()
380 if (cmp_code(opts, rm_test, fn+1) != 0) { in run_gen_check()
390 fini_raidz_map(&opts->zio_golden, &opts->rm_golden); in run_gen_check()
396 run_rec_check_impl(raidz_test_opts_t *opts, raidz_map_t *rm, const int fn) in run_rec_check_impl() argument
415 for (x0 = 0; x0 < opts->rto_dcols; x0++) { in run_rec_check_impl()
429 if (!opts->rto_sanity) in run_rec_check_impl()
432 if (cmp_data(opts, rm) != 0) { in run_rec_check_impl()
440 for (x0 = 0; x0 < opts->rto_dcols; x0++) { in run_rec_check_impl()
443 for (x1 = x0 + 1; x1 < opts->rto_dcols; x1++) { in run_rec_check_impl()
458 if (!opts->rto_sanity) in run_rec_check_impl()
462 if (cmp_data(opts, rm) != 0) { in run_rec_check_impl()
471 for (x0 = 0; x0 < opts->rto_dcols; x0++) { in run_rec_check_impl()
474 for (x1 = x0 + 1; x1 < opts->rto_dcols; x1++) { in run_rec_check_impl()
477 for (x2 = x1 + 1; x2 < opts->rto_dcols; x2++) { in run_rec_check_impl()
494 if (!opts->rto_sanity) in run_rec_check_impl()
498 if (cmp_data(opts, rm) != 0) { in run_rec_check_impl()
512 run_rec_check(raidz_test_opts_t *opts) in run_rec_check() argument
519 err = init_raidz_golden_map(opts, PARITY_PQR); in run_rec_check()
540 rm_test = init_raidz_map(opts, &zio_test, PARITY_PQR); in run_rec_check()
549 if (run_rec_check_impl(opts, rm_test, fn) != 0) { in run_rec_check()
561 fini_raidz_map(&opts->zio_golden, &opts->rm_golden); in run_rec_check()
567 run_test(raidz_test_opts_t *opts) in run_test() argument
571 if (opts == NULL) in run_test()
572 opts = &rto_opts; in run_test()
574 print_opts(opts, B_FALSE); in run_test()
576 err |= run_gen_check(opts); in run_test()
577 err |= run_rec_check(opts); in run_test()
599 raidz_test_opts_t *opts = (raidz_test_opts_t *)arg; in sweep_thread() local
600 VERIFY(opts != NULL); in sweep_thread()
602 err = run_test(opts); in sweep_thread()
612 memcpy(&failed_opts, opts, sizeof (raidz_test_opts_t)); in sweep_thread()
617 umem_free(opts, sizeof (raidz_test_opts_t)); in sweep_thread()
642 raidz_test_opts_t *opts; in run_sweep() local
692 opts = umem_zalloc(sizeof (raidz_test_opts_t), UMEM_NOFAIL); in run_sweep()
693 opts->rto_ashift = ashift_v[a]; in run_sweep()
694 opts->rto_dcols = dcols_v[d]; in run_sweep()
695 opts->rto_offset = (1 << ashift_v[a]) * rand(); in run_sweep()
696 opts->rto_dsize = size_v[s]; in run_sweep()
697 opts->rto_v = 0; /* be quiet */ in run_sweep()
699 VERIFY3P(thread_create(NULL, 0, sweep_thread, (void *) opts, in run_sweep()