- const uint64_t mc_start = rte_rdtsc();
- for (i = 0; i < iterations; i++) {
- rte_ring_mp_enqueue(r, burst);
- rte_ring_mc_dequeue(r, &burst);
+ rte_free(burst);
+
+ return 0;
+}
+
+static int
+load_loop_fn(void *p)
+{
+ struct thread_params *params = p;
+
+ return load_loop_fn_helper(params, -1);
+}
+
+static int
+load_loop_fn_16B(void *p)
+{
+ struct thread_params *params = p;
+
+ return load_loop_fn_helper(params, 16);
+}
+
+static int
+run_on_all_cores(struct rte_ring *r, const int esize)
+{
+ uint64_t total;
+ struct thread_params param;
+ lcore_function_t *lcore_f;
+ unsigned int i, c;
+
+ if (esize == -1)
+ lcore_f = load_loop_fn;
+ else
+ lcore_f = load_loop_fn_16B;
+
+ memset(¶m, 0, sizeof(struct thread_params));
+ for (i = 0; i < RTE_DIM(bulk_sizes); i++) {
+ total = 0;
+ printf("\nBulk enq/dequeue count on size %u\n", bulk_sizes[i]);
+ param.size = bulk_sizes[i];
+ param.r = r;
+
+ /* clear synchro and start workers */
+ rte_atomic32_set(&synchro, 0);
+ if (rte_eal_mp_remote_launch(lcore_f, ¶m, SKIP_MAIN) < 0)
+ return -1;
+
+ /* start synchro and launch test on main */
+ rte_atomic32_set(&synchro, 1);
+ lcore_f(¶m);
+
+ rte_eal_mp_wait_lcore();
+
+ RTE_LCORE_FOREACH(c) {
+ printf("Core [%u] count = %"PRIu64"\n",
+ c, queue_count[c]);
+ total += queue_count[c];
+ }
+
+ printf("Total count (size: %u): %"PRIu64"\n",
+ bulk_sizes[i], total);