| 145 | } |
| 146 | |
| 147 | static int32_t |
| 148 | check_updt_elem(struct ring_elem *elm[], uint32_t num, |
| 149 | const struct ring_elem *check, const struct ring_elem *fill) |
| 150 | { |
| 151 | uint32_t i; |
| 152 | |
| 153 | static rte_spinlock_t dump_lock; |
| 154 | |
| 155 | for (i = 0; i != num; i++) { |
| 156 | if (memcmp(check, elm[i], sizeof(*check)) != 0) { |
| 157 | rte_spinlock_lock(&dump_lock); |
| 158 | printf("%s(lc=%u, num=%u) failed at %u-th iter, " |
| 159 | "offending object: %p\n", |
| 160 | __func__, rte_lcore_id(), num, i, elm[i]); |
| 161 | rte_memdump(stdout, "expected", check, sizeof(*check)); |
| 162 | rte_memdump(stdout, "result", elm[i], sizeof(*elm[i])); |
| 163 | rte_spinlock_unlock(&dump_lock); |
| 164 | return -EINVAL; |
| 165 | } |
| 166 | memcpy(elm[i], fill, sizeof(*elm[i])); |
| 167 | } |
| 168 | |
| 169 | return 0; |
| 170 | } |
| 171 | |
| 172 | static int |
| 173 | check_ring_op(uint32_t exp, uint32_t res, uint32_t lc, |
no test coverage detected