struct rte_mbuf *returns[BURST*2];
unsigned int i, count;
unsigned int retries;
+ unsigned int processed;
printf("=== Basic distributor sanity tests ===\n");
clear_packet_count();
for (i = 0; i < BURST; i++)
bufs[i]->hash.usr = 0;
- rte_distributor_process(db, bufs, BURST);
+ processed = 0;
+ while (processed < BURST)
+ processed += rte_distributor_process(db, &bufs[processed],
+ BURST - processed);
+
count = 0;
do {
printf("Line %d: Error, not all packets flushed. "
"Expected %u, got %u\n",
__LINE__, BURST, total_packet_count());
+ rte_mempool_put_bulk(p, (void *)bufs, BURST);
return -1;
}
printf("Line %d: Error, not all packets flushed. "
"Expected %u, got %u\n",
__LINE__, BURST, total_packet_count());
+ rte_mempool_put_bulk(p, (void *)bufs, BURST);
return -1;
}
printf("Line %d: Error, not all packets flushed. "
"Expected %u, got %u\n",
__LINE__, BURST, total_packet_count());
+ rte_mempool_put_bulk(p, (void *)bufs, BURST);
return -1;
}
if (num_returned != BIG_BATCH) {
printf("line %d: Missing packets, expected %d\n",
__LINE__, num_returned);
+ rte_mempool_put_bulk(p, (void *)many_bufs, BIG_BATCH);
return -1;
}
if (j == BIG_BATCH) {
printf("Error: could not find source packet #%u\n", i);
+ rte_mempool_put_bulk(p, (void *)many_bufs, BIG_BATCH);
return -1;
}
}
struct rte_distributor *d = wp->dist;
unsigned i;
struct rte_mbuf *bufs[BURST];
+ unsigned int processed;
printf("=== Sanity test with mbuf alloc/free (%s) ===\n", wp->name);
bufs[j]->hash.usr = (i+j) << 1;
}
- rte_distributor_process(d, bufs, BURST);
+ processed = 0;
+ while (processed < BURST)
+ processed += rte_distributor_process(d,
+ &bufs[processed], BURST - processed);
}
rte_distributor_flush(d);
struct rte_mbuf *bufs2[BURST];
unsigned int i;
unsigned int failed = 0;
+ unsigned int processed = 0;
printf("=== Sanity test of worker shutdown ===\n");
for (i = 0; i < BURST; i++)
bufs[i]->hash.usr = 1;
- rte_distributor_process(d, bufs, BURST);
+ processed = 0;
+ while (processed < BURST)
+ processed += rte_distributor_process(d, &bufs[processed],
+ BURST - processed);
rte_distributor_flush(d);
/* at this point, we will have processed some packets and have a full
struct rte_mbuf *bufs[BURST];
unsigned int i;
unsigned int failed = 0;
+ unsigned int processed;
printf("=== Test flush fn with worker shutdown (%s) ===\n", wp->name);
for (i = 0; i < BURST; i++)
bufs[i]->hash.usr = 0;
- rte_distributor_process(d, bufs, BURST);
+ processed = 0;
+ while (processed < BURST)
+ processed += rte_distributor_process(d, &bufs[processed],
+ BURST - processed);
/* at this point, we will have processed some packets and have a full
* backlog for the other ones at worker 0.
*/
unsigned int i, count, id;
unsigned int sorted[buf_count], seq;
unsigned int failed = 0;
+ unsigned int processed;
printf("=== Marked packets test ===\n");
clear_packet_count();
count = 0;
for (i = 0; i < buf_count/burst; i++) {
- rte_distributor_process(db, &bufs[i * burst], burst);
+ processed = 0;
+ while (processed < burst)
+ processed += rte_distributor_process(db,
+ &bufs[i * burst + processed],
+ burst - processed);
count += rte_distributor_returned_pkts(db, &returns[count],
buf_count - count);
}
zero_quit = 0;
quit = 1;
- for (i = 0; i < num_workers; i++)
+ for (i = 0; i < num_workers; i++) {
bufs[i]->hash.usr = i << 1;
- rte_distributor_process(d, bufs, num_workers);
+ rte_distributor_process(d, &bufs[i], 1);
+ }
rte_distributor_process(d, NULL, 0);
rte_distributor_flush(d);
sizeof(worker_params.name));
rte_eal_mp_remote_launch(handle_work,
- &worker_params, SKIP_MASTER);
+ &worker_params, SKIP_MAIN);
if (sanity_test(&worker_params, p) < 0)
goto err;
quit_workers(&worker_params, p);
rte_eal_mp_remote_launch(handle_work_with_free_mbufs,
- &worker_params, SKIP_MASTER);
+ &worker_params, SKIP_MAIN);
if (sanity_test_with_mbuf_alloc(&worker_params, p) < 0)
goto err;
quit_workers(&worker_params, p);
if (rte_lcore_count() > 2) {
rte_eal_mp_remote_launch(handle_work_for_shutdown_test,
&worker_params,
- SKIP_MASTER);
+ SKIP_MAIN);
if (sanity_test_with_worker_shutdown(&worker_params,
p) < 0)
goto err;
rte_eal_mp_remote_launch(handle_work_for_shutdown_test,
&worker_params,
- SKIP_MASTER);
+ SKIP_MAIN);
if (test_flush_with_worker_shutdown(&worker_params,
p) < 0)
goto err;
quit_workers(&worker_params, p);
rte_eal_mp_remote_launch(handle_and_mark_work,
- &worker_params, SKIP_MASTER);
+ &worker_params, SKIP_MAIN);
if (sanity_mark_test(&worker_params, p) < 0)
goto err;
quit_workers(&worker_params, p);