X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest%2Ftest_distributor.c;h=eb889b91d119f03ff1993823967d0e6cf2360281;hb=cb056611a8ed9ab9024f3b91bf26e97255194514;hp=a4af0a39c66028a4ecfe35ef1e44543e12cfd860;hpb=e1f1400cf6b85bbb6f4b7b088d54758e210343e7;p=dpdk.git diff --git a/app/test/test_distributor.c b/app/test/test_distributor.c index a4af0a39c6..eb889b91d1 100644 --- a/app/test/test_distributor.c +++ b/app/test/test_distributor.c @@ -134,6 +134,7 @@ sanity_test(struct worker_params *wp, struct rte_mempool *p) 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; } @@ -160,6 +161,7 @@ sanity_test(struct worker_params *wp, struct rte_mempool *p) 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; } @@ -188,6 +190,7 @@ sanity_test(struct worker_params *wp, struct rte_mempool *p) 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; } @@ -243,6 +246,7 @@ sanity_test(struct worker_params *wp, struct rte_mempool *p) 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; } @@ -257,6 +261,7 @@ sanity_test(struct worker_params *wp, struct rte_mempool *p) 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; } } @@ -769,9 +774,10 @@ quit_workers(struct worker_params *wp, struct rte_mempool *p) 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); @@ -856,13 +862,13 @@ test_distributor(void) 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); @@ -870,7 +876,7 @@ test_distributor(void) 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; @@ -878,14 +884,14 @@ test_distributor(void) 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);