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

Function test_bulk_push_pop

dpdk/app/test/test_stack_perf.c:272–295  ·  view source on GitHub ↗

Measure the cycle cost of bulk pushing and popping on a single lcore. */

Source from the content-addressed store, hash-verified

270
271/* Measure the cycle cost of bulk pushing and popping on a single lcore. */
272static void
273test_bulk_push_pop(struct rte_stack *s)
274{
275 unsigned int iterations = 8000000;
276 void *objs[MAX_BURST];
277 unsigned int sz, i;
278
279 for (sz = 0; sz < RTE_DIM(bulk_sizes); sz++) {
280 uint64_t start = rte_rdtsc();
281
282 for (i = 0; i < iterations; i++) {
283 rte_stack_push(s, objs, bulk_sizes[sz]);
284 rte_stack_pop(s, objs, bulk_sizes[sz]);
285 }
286
287 uint64_t end = rte_rdtsc();
288
289 double avg = ((double)(end - start) /
290 (iterations * bulk_sizes[sz]));
291
292 printf("Average cycles per object push/pop (bulk size: %u): %.2F\n",
293 bulk_sizes[sz], avg);
294 }
295}
296
297static int
298__test_stack_perf(uint32_t flags)

Callers 1

__test_stack_perfFunction · 0.85

Calls 4

rte_stack_pushFunction · 0.85
rte_stack_popFunction · 0.85
rte_rdtscFunction · 0.50
printfFunction · 0.50

Tested by

no test coverage detected