6cd7a2edda1d15d2a83382f5dfd8e8d5c1e6ee38
[dpdk.git] / app / test / test_distributor.c
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2010-2017 Intel Corporation
3  */
4
5 #include "test.h"
6
7 #include <unistd.h>
8 #include <string.h>
9 #include <rte_cycles.h>
10 #include <rte_errno.h>
11 #include <rte_mempool.h>
12 #include <rte_mbuf.h>
13 #include <rte_distributor.h>
14 #include <rte_string_fns.h>
15
16 #define ITER_POWER 20 /* log 2 of how many iterations we do when timing. */
17 #define BURST 32
18 #define BIG_BATCH 1024
19
20 struct worker_params {
21         char name[64];
22         struct rte_distributor *dist;
23 };
24
25 struct worker_params worker_params;
26
27 /* statics - all zero-initialized by default */
28 static volatile int quit;      /**< general quit variable for all threads */
29 static volatile int zero_quit; /**< var for when we just want thr0 to quit*/
30 static volatile unsigned worker_idx;
31 static volatile unsigned zero_idx;
32
33 struct worker_stats {
34         volatile unsigned handled_packets;
35 } __rte_cache_aligned;
36 struct worker_stats worker_stats[RTE_MAX_LCORE];
37
38 /* returns the total count of the number of packets handled by the worker
39  * functions given below.
40  */
41 static inline unsigned
42 total_packet_count(void)
43 {
44         unsigned i, count = 0;
45         for (i = 0; i < worker_idx; i++)
46                 count += worker_stats[i].handled_packets;
47         return count;
48 }
49
50 /* resets the packet counts for a new test */
51 static inline void
52 clear_packet_count(void)
53 {
54         memset(&worker_stats, 0, sizeof(worker_stats));
55 }
56
57 /* this is the basic worker function for sanity test
58  * it does nothing but return packets and count them.
59  */
60 static int
61 handle_work(void *arg)
62 {
63         struct rte_mbuf *buf[8] __rte_cache_aligned;
64         struct worker_params *wp = arg;
65         struct rte_distributor *db = wp->dist;
66         unsigned int count = 0, num;
67         unsigned int id = __atomic_fetch_add(&worker_idx, 1, __ATOMIC_RELAXED);
68
69         num = rte_distributor_get_pkt(db, id, buf, NULL, 0);
70         while (!quit) {
71                 __atomic_fetch_add(&worker_stats[id].handled_packets, num,
72                                 __ATOMIC_RELAXED);
73                 count += num;
74                 num = rte_distributor_get_pkt(db, id,
75                                 buf, buf, num);
76         }
77         __atomic_fetch_add(&worker_stats[id].handled_packets, num,
78                         __ATOMIC_RELAXED);
79         count += num;
80         rte_distributor_return_pkt(db, id, buf, num);
81         return 0;
82 }
83
84 /* do basic sanity testing of the distributor. This test tests the following:
85  * - send 32 packets through distributor with the same tag and ensure they
86  *   all go to the one worker
87  * - send 32 packets through the distributor with two different tags and
88  *   verify that they go equally to two different workers.
89  * - send 32 packets with different tags through the distributors and
90  *   just verify we get all packets back.
91  * - send 1024 packets through the distributor, gathering the returned packets
92  *   as we go. Then verify that we correctly got all 1024 pointers back again,
93  *   not necessarily in the same order (as different flows).
94  */
95 static int
96 sanity_test(struct worker_params *wp, struct rte_mempool *p)
97 {
98         struct rte_distributor *db = wp->dist;
99         struct rte_mbuf *bufs[BURST];
100         struct rte_mbuf *returns[BURST*2];
101         unsigned int i, count;
102         unsigned int retries;
103
104         printf("=== Basic distributor sanity tests ===\n");
105         clear_packet_count();
106         if (rte_mempool_get_bulk(p, (void *)bufs, BURST) != 0) {
107                 printf("line %d: Error getting mbufs from pool\n", __LINE__);
108                 return -1;
109         }
110
111         /* now set all hash values in all buffers to zero, so all pkts go to the
112          * one worker thread */
113         for (i = 0; i < BURST; i++)
114                 bufs[i]->hash.usr = 0;
115
116         rte_distributor_process(db, bufs, BURST);
117         count = 0;
118         do {
119
120                 rte_distributor_flush(db);
121                 count += rte_distributor_returned_pkts(db,
122                                 returns, BURST*2);
123         } while (count < BURST);
124
125         if (total_packet_count() != BURST) {
126                 printf("Line %d: Error, not all packets flushed. "
127                                 "Expected %u, got %u\n",
128                                 __LINE__, BURST, total_packet_count());
129                 return -1;
130         }
131
132         for (i = 0; i < rte_lcore_count() - 1; i++)
133                 printf("Worker %u handled %u packets\n", i,
134                                 worker_stats[i].handled_packets);
135         printf("Sanity test with all zero hashes done.\n");
136
137         /* pick two flows and check they go correctly */
138         if (rte_lcore_count() >= 3) {
139                 clear_packet_count();
140                 for (i = 0; i < BURST; i++)
141                         bufs[i]->hash.usr = (i & 1) << 8;
142
143                 rte_distributor_process(db, bufs, BURST);
144                 count = 0;
145                 do {
146                         rte_distributor_flush(db);
147                         count += rte_distributor_returned_pkts(db,
148                                         returns, BURST*2);
149                 } while (count < BURST);
150                 if (total_packet_count() != BURST) {
151                         printf("Line %d: Error, not all packets flushed. "
152                                         "Expected %u, got %u\n",
153                                         __LINE__, BURST, total_packet_count());
154                         return -1;
155                 }
156
157                 for (i = 0; i < rte_lcore_count() - 1; i++)
158                         printf("Worker %u handled %u packets\n", i,
159                                         worker_stats[i].handled_packets);
160                 printf("Sanity test with two hash values done\n");
161         }
162
163         /* give a different hash value to each packet,
164          * so load gets distributed */
165         clear_packet_count();
166         for (i = 0; i < BURST; i++)
167                 bufs[i]->hash.usr = i+1;
168
169         rte_distributor_process(db, bufs, BURST);
170         count = 0;
171         do {
172                 rte_distributor_flush(db);
173                 count += rte_distributor_returned_pkts(db,
174                                 returns, BURST*2);
175         } while (count < BURST);
176         if (total_packet_count() != BURST) {
177                 printf("Line %d: Error, not all packets flushed. "
178                                 "Expected %u, got %u\n",
179                                 __LINE__, BURST, total_packet_count());
180                 return -1;
181         }
182
183         for (i = 0; i < rte_lcore_count() - 1; i++)
184                 printf("Worker %u handled %u packets\n", i,
185                                 worker_stats[i].handled_packets);
186         printf("Sanity test with non-zero hashes done\n");
187
188         rte_mempool_put_bulk(p, (void *)bufs, BURST);
189
190         /* sanity test with BIG_BATCH packets to ensure they all arrived back
191          * from the returned packets function */
192         clear_packet_count();
193         struct rte_mbuf *many_bufs[BIG_BATCH], *return_bufs[BIG_BATCH];
194         unsigned num_returned = 0;
195
196         /* flush out any remaining packets */
197         rte_distributor_flush(db);
198         rte_distributor_clear_returns(db);
199
200         if (rte_mempool_get_bulk(p, (void *)many_bufs, BIG_BATCH) != 0) {
201                 printf("line %d: Error getting mbufs from pool\n", __LINE__);
202                 return -1;
203         }
204         for (i = 0; i < BIG_BATCH; i++)
205                 many_bufs[i]->hash.usr = i << 2;
206
207         printf("=== testing big burst (%s) ===\n", wp->name);
208         for (i = 0; i < BIG_BATCH/BURST; i++) {
209                 rte_distributor_process(db,
210                                 &many_bufs[i*BURST], BURST);
211                 count = rte_distributor_returned_pkts(db,
212                                 &return_bufs[num_returned],
213                                 BIG_BATCH - num_returned);
214                 num_returned += count;
215         }
216         rte_distributor_flush(db);
217         count = rte_distributor_returned_pkts(db,
218                 &return_bufs[num_returned],
219                         BIG_BATCH - num_returned);
220         num_returned += count;
221         retries = 0;
222         do {
223                 rte_distributor_flush(db);
224                 count = rte_distributor_returned_pkts(db,
225                                 &return_bufs[num_returned],
226                                 BIG_BATCH - num_returned);
227                 num_returned += count;
228                 retries++;
229         } while ((num_returned < BIG_BATCH) && (retries < 100));
230
231         if (num_returned != BIG_BATCH) {
232                 printf("line %d: Missing packets, expected %d\n",
233                                 __LINE__, num_returned);
234                 return -1;
235         }
236
237         /* big check -  make sure all packets made it back!! */
238         for (i = 0; i < BIG_BATCH; i++) {
239                 unsigned j;
240                 struct rte_mbuf *src = many_bufs[i];
241                 for (j = 0; j < BIG_BATCH; j++) {
242                         if (return_bufs[j] == src)
243                                 break;
244                 }
245
246                 if (j == BIG_BATCH) {
247                         printf("Error: could not find source packet #%u\n", i);
248                         return -1;
249                 }
250         }
251         printf("Sanity test of returned packets done\n");
252
253         rte_mempool_put_bulk(p, (void *)many_bufs, BIG_BATCH);
254
255         printf("\n");
256         return 0;
257 }
258
259
260 /* to test that the distributor does not lose packets, we use this worker
261  * function which frees mbufs when it gets them. The distributor thread does
262  * the mbuf allocation. If distributor drops packets we'll eventually run out
263  * of mbufs.
264  */
265 static int
266 handle_work_with_free_mbufs(void *arg)
267 {
268         struct rte_mbuf *buf[8] __rte_cache_aligned;
269         struct worker_params *wp = arg;
270         struct rte_distributor *d = wp->dist;
271         unsigned int count = 0;
272         unsigned int i;
273         unsigned int num;
274         unsigned int id = __atomic_fetch_add(&worker_idx, 1, __ATOMIC_RELAXED);
275
276         num = rte_distributor_get_pkt(d, id, buf, NULL, 0);
277         while (!quit) {
278                 worker_stats[id].handled_packets += num;
279                 count += num;
280                 for (i = 0; i < num; i++)
281                         rte_pktmbuf_free(buf[i]);
282                 num = rte_distributor_get_pkt(d, id, buf, NULL, 0);
283         }
284         worker_stats[id].handled_packets += num;
285         count += num;
286         rte_distributor_return_pkt(d, id, buf, num);
287         return 0;
288 }
289
290 /* Perform a sanity test of the distributor with a large number of packets,
291  * where we allocate a new set of mbufs for each burst. The workers then
292  * free the mbufs. This ensures that we don't have any packet leaks in the
293  * library.
294  */
295 static int
296 sanity_test_with_mbuf_alloc(struct worker_params *wp, struct rte_mempool *p)
297 {
298         struct rte_distributor *d = wp->dist;
299         unsigned i;
300         struct rte_mbuf *bufs[BURST];
301
302         printf("=== Sanity test with mbuf alloc/free (%s) ===\n", wp->name);
303
304         clear_packet_count();
305         for (i = 0; i < ((1<<ITER_POWER)); i += BURST) {
306                 unsigned j;
307                 while (rte_mempool_get_bulk(p, (void *)bufs, BURST) < 0)
308                         rte_distributor_process(d, NULL, 0);
309                 for (j = 0; j < BURST; j++) {
310                         bufs[j]->hash.usr = (i+j) << 1;
311                         rte_mbuf_refcnt_set(bufs[j], 1);
312                 }
313
314                 rte_distributor_process(d, bufs, BURST);
315         }
316
317         rte_distributor_flush(d);
318
319         rte_delay_us(10000);
320
321         if (total_packet_count() < (1<<ITER_POWER)) {
322                 printf("Line %u: Packet count is incorrect, %u, expected %u\n",
323                                 __LINE__, total_packet_count(),
324                                 (1<<ITER_POWER));
325                 return -1;
326         }
327
328         printf("Sanity test with mbuf alloc/free passed\n\n");
329         return 0;
330 }
331
332 static int
333 handle_work_for_shutdown_test(void *arg)
334 {
335         struct rte_mbuf *pkt = NULL;
336         struct rte_mbuf *buf[8] __rte_cache_aligned;
337         struct worker_params *wp = arg;
338         struct rte_distributor *d = wp->dist;
339         unsigned int count = 0;
340         unsigned int num;
341         unsigned int total = 0;
342         unsigned int i;
343         unsigned int returned = 0;
344         unsigned int zero_id = 0;
345         unsigned int zero_unset;
346         const unsigned int id = __atomic_fetch_add(&worker_idx, 1,
347                         __ATOMIC_RELAXED);
348
349         num = rte_distributor_get_pkt(d, id, buf, NULL, 0);
350
351         if (num > 0) {
352                 zero_unset = RTE_MAX_LCORE;
353                 __atomic_compare_exchange_n(&zero_idx, &zero_unset, id,
354                         false, __ATOMIC_ACQ_REL, __ATOMIC_ACQUIRE);
355         }
356         zero_id = __atomic_load_n(&zero_idx, __ATOMIC_ACQUIRE);
357
358         /* wait for quit single globally, or for worker zero, wait
359          * for zero_quit */
360         while (!quit && !(id == zero_id && zero_quit)) {
361                 worker_stats[id].handled_packets += num;
362                 count += num;
363                 for (i = 0; i < num; i++)
364                         rte_pktmbuf_free(buf[i]);
365                 num = rte_distributor_get_pkt(d, id, buf, NULL, 0);
366
367                 if (num > 0) {
368                         zero_unset = RTE_MAX_LCORE;
369                         __atomic_compare_exchange_n(&zero_idx, &zero_unset, id,
370                                 false, __ATOMIC_ACQ_REL, __ATOMIC_ACQUIRE);
371                 }
372                 zero_id = __atomic_load_n(&zero_idx, __ATOMIC_ACQUIRE);
373
374                 total += num;
375         }
376         worker_stats[id].handled_packets += num;
377         count += num;
378         returned = rte_distributor_return_pkt(d, id, buf, num);
379
380         if (id == zero_id) {
381                 /* for worker zero, allow it to restart to pick up last packet
382                  * when all workers are shutting down.
383                  */
384                 while (zero_quit)
385                         usleep(100);
386
387                 num = rte_distributor_get_pkt(d, id, buf, NULL, 0);
388
389                 while (!quit) {
390                         worker_stats[id].handled_packets += num;
391                         count += num;
392                         rte_pktmbuf_free(pkt);
393                         num = rte_distributor_get_pkt(d, id, buf, NULL, 0);
394                 }
395                 returned = rte_distributor_return_pkt(d,
396                                 id, buf, num);
397                 printf("Num returned = %d\n", returned);
398         }
399         return 0;
400 }
401
402
403 /* Perform a sanity test of the distributor with a large number of packets,
404  * where we allocate a new set of mbufs for each burst. The workers then
405  * free the mbufs. This ensures that we don't have any packet leaks in the
406  * library.
407  */
408 static int
409 sanity_test_with_worker_shutdown(struct worker_params *wp,
410                 struct rte_mempool *p)
411 {
412         struct rte_distributor *d = wp->dist;
413         struct rte_mbuf *bufs[BURST];
414         unsigned i;
415
416         printf("=== Sanity test of worker shutdown ===\n");
417
418         clear_packet_count();
419
420         if (rte_mempool_get_bulk(p, (void *)bufs, BURST) != 0) {
421                 printf("line %d: Error getting mbufs from pool\n", __LINE__);
422                 return -1;
423         }
424
425         /*
426          * Now set all hash values in all buffers to same value so all
427          * pkts go to the one worker thread
428          */
429         for (i = 0; i < BURST; i++)
430                 bufs[i]->hash.usr = 1;
431
432         rte_distributor_process(d, bufs, BURST);
433         rte_distributor_flush(d);
434
435         /* at this point, we will have processed some packets and have a full
436          * backlog for the other ones at worker 0.
437          */
438
439         /* get more buffers to queue up, again setting them to the same flow */
440         if (rte_mempool_get_bulk(p, (void *)bufs, BURST) != 0) {
441                 printf("line %d: Error getting mbufs from pool\n", __LINE__);
442                 return -1;
443         }
444         for (i = 0; i < BURST; i++)
445                 bufs[i]->hash.usr = 1;
446
447         /* get worker zero to quit */
448         zero_quit = 1;
449         rte_distributor_process(d, bufs, BURST);
450
451         /* flush the distributor */
452         rte_distributor_flush(d);
453         rte_delay_us(10000);
454
455         for (i = 0; i < rte_lcore_count() - 1; i++)
456                 printf("Worker %u handled %u packets\n", i,
457                                 worker_stats[i].handled_packets);
458
459         if (total_packet_count() != BURST * 2) {
460                 printf("Line %d: Error, not all packets flushed. "
461                                 "Expected %u, got %u\n",
462                                 __LINE__, BURST * 2, total_packet_count());
463                 return -1;
464         }
465
466         printf("Sanity test with worker shutdown passed\n\n");
467         return 0;
468 }
469
470 /* Test that the flush function is able to move packets between workers when
471  * one worker shuts down..
472  */
473 static int
474 test_flush_with_worker_shutdown(struct worker_params *wp,
475                 struct rte_mempool *p)
476 {
477         struct rte_distributor *d = wp->dist;
478         struct rte_mbuf *bufs[BURST];
479         unsigned i;
480
481         printf("=== Test flush fn with worker shutdown (%s) ===\n", wp->name);
482
483         clear_packet_count();
484         if (rte_mempool_get_bulk(p, (void *)bufs, BURST) != 0) {
485                 printf("line %d: Error getting mbufs from pool\n", __LINE__);
486                 return -1;
487         }
488
489         /* now set all hash values in all buffers to zero, so all pkts go to the
490          * one worker thread */
491         for (i = 0; i < BURST; i++)
492                 bufs[i]->hash.usr = 0;
493
494         rte_distributor_process(d, bufs, BURST);
495         /* at this point, we will have processed some packets and have a full
496          * backlog for the other ones at worker 0.
497          */
498
499         /* get worker zero to quit */
500         zero_quit = 1;
501
502         /* flush the distributor */
503         rte_distributor_flush(d);
504
505         rte_delay_us(10000);
506
507         zero_quit = 0;
508         for (i = 0; i < rte_lcore_count() - 1; i++)
509                 printf("Worker %u handled %u packets\n", i,
510                                 worker_stats[i].handled_packets);
511
512         if (total_packet_count() != BURST) {
513                 printf("Line %d: Error, not all packets flushed. "
514                                 "Expected %u, got %u\n",
515                                 __LINE__, BURST, total_packet_count());
516                 return -1;
517         }
518
519         printf("Flush test with worker shutdown passed\n\n");
520         return 0;
521 }
522
523 static
524 int test_error_distributor_create_name(void)
525 {
526         struct rte_distributor *d = NULL;
527         struct rte_distributor *db = NULL;
528         char *name = NULL;
529
530         d = rte_distributor_create(name, rte_socket_id(),
531                         rte_lcore_count() - 1,
532                         RTE_DIST_ALG_SINGLE);
533         if (d != NULL || rte_errno != EINVAL) {
534                 printf("ERROR: No error on create() with NULL name param\n");
535                 return -1;
536         }
537
538         db = rte_distributor_create(name, rte_socket_id(),
539                         rte_lcore_count() - 1,
540                         RTE_DIST_ALG_BURST);
541         if (db != NULL || rte_errno != EINVAL) {
542                 printf("ERROR: No error on create() with NULL param\n");
543                 return -1;
544         }
545
546         return 0;
547 }
548
549
550 static
551 int test_error_distributor_create_numworkers(void)
552 {
553         struct rte_distributor *ds = NULL;
554         struct rte_distributor *db = NULL;
555
556         ds = rte_distributor_create("test_numworkers", rte_socket_id(),
557                         RTE_MAX_LCORE + 10,
558                         RTE_DIST_ALG_SINGLE);
559         if (ds != NULL || rte_errno != EINVAL) {
560                 printf("ERROR: No error on create() with num_workers > MAX\n");
561                 return -1;
562         }
563
564         db = rte_distributor_create("test_numworkers", rte_socket_id(),
565                         RTE_MAX_LCORE + 10,
566                         RTE_DIST_ALG_BURST);
567         if (db != NULL || rte_errno != EINVAL) {
568                 printf("ERROR: No error on create() num_workers > MAX\n");
569                 return -1;
570         }
571
572         return 0;
573 }
574
575
576 /* Useful function which ensures that all worker functions terminate */
577 static void
578 quit_workers(struct worker_params *wp, struct rte_mempool *p)
579 {
580         struct rte_distributor *d = wp->dist;
581         const unsigned num_workers = rte_lcore_count() - 1;
582         unsigned i;
583         struct rte_mbuf *bufs[RTE_MAX_LCORE];
584         rte_mempool_get_bulk(p, (void *)bufs, num_workers);
585
586         zero_quit = 0;
587         quit = 1;
588         for (i = 0; i < num_workers; i++)
589                 bufs[i]->hash.usr = i << 1;
590         rte_distributor_process(d, bufs, num_workers);
591
592         rte_mempool_put_bulk(p, (void *)bufs, num_workers);
593
594         rte_distributor_process(d, NULL, 0);
595         rte_distributor_flush(d);
596         rte_eal_mp_wait_lcore();
597         quit = 0;
598         worker_idx = 0;
599         zero_idx = RTE_MAX_LCORE;
600 }
601
602 static int
603 test_distributor(void)
604 {
605         static struct rte_distributor *ds;
606         static struct rte_distributor *db;
607         static struct rte_distributor *dist[2];
608         static struct rte_mempool *p;
609         int i;
610
611         if (rte_lcore_count() < 2) {
612                 printf("Not enough cores for distributor_autotest, expecting at least 2\n");
613                 return TEST_SKIPPED;
614         }
615
616         if (db == NULL) {
617                 db = rte_distributor_create("Test_dist_burst", rte_socket_id(),
618                                 rte_lcore_count() - 1,
619                                 RTE_DIST_ALG_BURST);
620                 if (db == NULL) {
621                         printf("Error creating burst distributor\n");
622                         return -1;
623                 }
624         } else {
625                 rte_distributor_flush(db);
626                 rte_distributor_clear_returns(db);
627         }
628
629         if (ds == NULL) {
630                 ds = rte_distributor_create("Test_dist_single",
631                                 rte_socket_id(),
632                                 rte_lcore_count() - 1,
633                         RTE_DIST_ALG_SINGLE);
634                 if (ds == NULL) {
635                         printf("Error creating single distributor\n");
636                         return -1;
637                 }
638         } else {
639                 rte_distributor_flush(ds);
640                 rte_distributor_clear_returns(ds);
641         }
642
643         const unsigned nb_bufs = (511 * rte_lcore_count()) < BIG_BATCH ?
644                         (BIG_BATCH * 2) - 1 : (511 * rte_lcore_count());
645         if (p == NULL) {
646                 p = rte_pktmbuf_pool_create("DT_MBUF_POOL", nb_bufs, BURST,
647                         0, RTE_MBUF_DEFAULT_BUF_SIZE, rte_socket_id());
648                 if (p == NULL) {
649                         printf("Error creating mempool\n");
650                         return -1;
651                 }
652         }
653
654         dist[0] = ds;
655         dist[1] = db;
656
657         for (i = 0; i < 2; i++) {
658
659                 worker_params.dist = dist[i];
660                 if (i)
661                         strlcpy(worker_params.name, "burst",
662                                         sizeof(worker_params.name));
663                 else
664                         strlcpy(worker_params.name, "single",
665                                         sizeof(worker_params.name));
666
667                 rte_eal_mp_remote_launch(handle_work,
668                                 &worker_params, SKIP_MASTER);
669                 if (sanity_test(&worker_params, p) < 0)
670                         goto err;
671                 quit_workers(&worker_params, p);
672
673                 rte_eal_mp_remote_launch(handle_work_with_free_mbufs,
674                                 &worker_params, SKIP_MASTER);
675                 if (sanity_test_with_mbuf_alloc(&worker_params, p) < 0)
676                         goto err;
677                 quit_workers(&worker_params, p);
678
679                 if (rte_lcore_count() > 2) {
680                         rte_eal_mp_remote_launch(handle_work_for_shutdown_test,
681                                         &worker_params,
682                                         SKIP_MASTER);
683                         if (sanity_test_with_worker_shutdown(&worker_params,
684                                         p) < 0)
685                                 goto err;
686                         quit_workers(&worker_params, p);
687
688                         rte_eal_mp_remote_launch(handle_work_for_shutdown_test,
689                                         &worker_params,
690                                         SKIP_MASTER);
691                         if (test_flush_with_worker_shutdown(&worker_params,
692                                         p) < 0)
693                                 goto err;
694                         quit_workers(&worker_params, p);
695
696                 } else {
697                         printf("Too few cores to run worker shutdown test\n");
698                 }
699
700         }
701
702         if (test_error_distributor_create_numworkers() == -1 ||
703                         test_error_distributor_create_name() == -1) {
704                 printf("rte_distributor_create parameter check tests failed");
705                 return -1;
706         }
707
708         return 0;
709
710 err:
711         quit_workers(&worker_params, p);
712         return -1;
713 }
714
715 REGISTER_TEST_COMMAND(distributor_autotest, test_distributor);