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

Function bulk_push_pop

dpdk/app/test/test_stack_perf.c:134–161  ·  view source on GitHub ↗

Measure the average per-pointer cycle cost of stack push and pop */

Source from the content-addressed store, hash-verified

132
133/* Measure the average per-pointer cycle cost of stack push and pop */
134static int
135bulk_push_pop(void *p)
136{
137 unsigned int iterations = 1000000;
138 struct thread_args *args = p;
139 void *objs[MAX_BURST] = {0};
140 unsigned int size, i;
141 struct rte_stack *s;
142
143 s = args->s;
144 size = args->sz;
145
146 __atomic_fetch_sub(&lcore_barrier, 1, __ATOMIC_RELAXED);
147 rte_wait_until_equal_32(&lcore_barrier, 0, __ATOMIC_RELAXED);
148
149 uint64_t start = rte_rdtsc();
150
151 for (i = 0; i < iterations; i++) {
152 rte_stack_push(s, objs, size);
153 rte_stack_pop(s, objs, size);
154 }
155
156 uint64_t end = rte_rdtsc();
157
158 args->avg = ((double)(end - start))/(iterations * size);
159
160 return 0;
161}
162
163/*
164 * Run bulk_push_pop() simultaneously on pairs of cores, to measure stack

Callers

nothing calls this directly

Calls 4

rte_stack_pushFunction · 0.85
rte_stack_popFunction · 0.85
rte_wait_until_equal_32Function · 0.50
rte_rdtscFunction · 0.50

Tested by

no test coverage detected