(3, 4)
| 50 | }; |
| 51 | |
| 52 | static void |
| 53 | __rte_format_printf(3, 4) |
| 54 | print_err(const char *func, int lineno, const char *format, ...) |
| 55 | { |
| 56 | va_list ap; |
| 57 | |
| 58 | fprintf(stderr, "In %s:%d - ", func, lineno); |
| 59 | va_start(ap, format); |
| 60 | vfprintf(stderr, format, ap); |
| 61 | va_end(ap); |
| 62 | } |
| 63 | |
| 64 | static int |
| 65 | runtest(const char *printable, int (*test_fn)(int16_t dev_id, uint16_t vchan), int iterations, |
| 66 | int16_t dev_id, uint16_t vchan, bool check_err_stats) |
| 67 | { |
| 68 | struct rte_dma_stats stats; |
| 69 | int i; |
| 70 | |
| 71 | rte_dma_stats_reset(dev_id, vchan); |
| 72 | printf("DMA Dev %d: Running %s Tests %s\n", dev_id, printable, |
| 73 | check_err_stats ? " " : "(errors expected)"); |
| 74 | for (i = 0; i < iterations; i++) { |
| 75 | if (test_fn(dev_id, vchan) < 0) |
| 76 | return -1; |
| 77 | |
| 78 | rte_dma_stats_get(dev_id, 0, &stats); |
| 79 | printf("Ops submitted: %"PRIu64"\t", stats.submitted); |
| 80 | printf("Ops completed: %"PRIu64"\t", stats.completed); |
| 81 | printf("Errors: %"PRIu64"\r", stats.errors); |
| 82 | |
| 83 | if (stats.completed != stats.submitted) |
| 84 | ERR_RETURN("\nError, not all submitted jobs are reported as completed\n"); |
| 85 | if (check_err_stats && stats.errors != 0) |
| 86 | ERR_RETURN("\nErrors reported during op processing, aborting tests\n"); |
| 87 | } |
| 88 | printf("\n"); |
| 89 | return 0; |
| 90 | } |
| 91 | |
| 92 | static void |
| 93 | await_hw(int16_t dev_id, uint16_t vchan) |
no test coverage detected