Measure the average per-pointer cycle cost of stack push and pop */
| 132 | |
| 133 | /* Measure the average per-pointer cycle cost of stack push and pop */ |
| 134 | static int |
| 135 | bulk_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 |
nothing calls this directly
no test coverage detected