MCPcopy Create free account
hub / github.com/F-Stack/f-stack / check_updt_elem

Function check_updt_elem

dpdk/app/test/test_ring_stress_impl.h:147–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145}
146
147static int32_t
148check_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
172static int
173check_ring_op(uint32_t exp, uint32_t res, uint32_t lc,

Callers 1

test_workerFunction · 0.85

Calls 6

rte_lcore_idFunction · 0.85
rte_memdumpFunction · 0.85
rte_spinlock_lockFunction · 0.50
printfFunction · 0.50
rte_spinlock_unlockFunction · 0.50
memcpyFunction · 0.50

Tested by

no test coverage detected