first public release
[dpdk.git] / app / test / test_mempool.c
1 /*-
2  *   BSD LICENSE
3  * 
4  *   Copyright(c) 2010-2012 Intel Corporation. All rights reserved.
5  *   All rights reserved.
6  * 
7  *   Redistribution and use in source and binary forms, with or without 
8  *   modification, are permitted provided that the following conditions 
9  *   are met:
10  * 
11  *     * Redistributions of source code must retain the above copyright 
12  *       notice, this list of conditions and the following disclaimer.
13  *     * Redistributions in binary form must reproduce the above copyright 
14  *       notice, this list of conditions and the following disclaimer in 
15  *       the documentation and/or other materials provided with the 
16  *       distribution.
17  *     * Neither the name of Intel Corporation nor the names of its 
18  *       contributors may be used to endorse or promote products derived 
19  *       from this software without specific prior written permission.
20  * 
21  *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
22  *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
23  *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
24  *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
25  *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
26  *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
27  *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
28  *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
29  *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
30  *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
31  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  * 
33  *  version: DPDK.L.1.2.3-3
34  */
35
36 #include <string.h>
37 #include <stdio.h>
38 #include <stdlib.h>
39 #include <stdint.h>
40 #include <inttypes.h>
41 #include <stdarg.h>
42 #include <errno.h>
43 #include <sys/queue.h>
44
45 #include <rte_common.h>
46 #include <rte_log.h>
47 #include <rte_debug.h>
48 #include <rte_memory.h>
49 #include <rte_memzone.h>
50 #include <rte_launch.h>
51 #include <rte_cycles.h>
52 #include <rte_tailq.h>
53 #include <rte_eal.h>
54 #include <rte_per_lcore.h>
55 #include <rte_lcore.h>
56 #include <rte_atomic.h>
57 #include <rte_branch_prediction.h>
58 #include <rte_ring.h>
59 #include <rte_mempool.h>
60 #include <rte_spinlock.h>
61 #include <rte_malloc.h>
62
63 #include <cmdline_parse.h>
64
65 #include "test.h"
66
67 /*
68  * Mempool
69  * =======
70  *
71  * #. Basic tests: done on one core with and without cache:
72  *
73  *    - Get one object, put one object
74  *    - Get two objects, put two objects
75  *    - Get all objects, test that their content is not modified and
76  *      put them back in the pool.
77  *
78  * #. Performance tests:
79  *
80  *    Each core get *n_keep* objects per bulk of *n_get_bulk*. Then,
81  *    objects are put back in the pool per bulk of *n_put_bulk*.
82  *
83  *    This sequence is done during TIME_S seconds.
84  *
85  *    This test is done on the following configurations:
86  *
87  *    - Cores configuration (*cores*)
88  *
89  *      - One core with cache
90  *      - Two cores with cache
91  *      - Max. cores with cache
92  *      - One core without cache
93  *      - Two cores without cache
94  *      - Max. cores without cache
95  *
96  *    - Bulk size (*n_get_bulk*, *n_put_bulk*)
97  *
98  *      - Bulk get from 1 to 32
99  *      - Bulk put from 1 to 32
100  *
101  *    - Number of kept objects (*n_keep*)
102  *
103  *      - 32
104  *      - 128
105  */
106
107 #define N 65536
108 #define TIME_S 5
109 #define MEMPOOL_ELT_SIZE 2048
110 #define MAX_KEEP 128
111 #define MEMPOOL_SIZE ((RTE_MAX_LCORE*(MAX_KEEP+RTE_MEMPOOL_CACHE_MAX_SIZE))-1)
112
113 static struct rte_mempool *mp;
114 static struct rte_mempool *mp_cache, *mp_nocache;
115
116 static rte_atomic32_t synchro;
117
118 /* number of objects in one bulk operation (get or put) */
119 static unsigned n_get_bulk;
120 static unsigned n_put_bulk;
121
122 /* number of objects retrived from mempool before putting them back */
123 static unsigned n_keep;
124
125 /* number of enqueues / dequeues */
126 struct mempool_test_stats {
127         unsigned enq_count;
128 } __rte_cache_aligned;
129
130 static struct mempool_test_stats stats[RTE_MAX_LCORE];
131
132 static int
133 per_lcore_mempool_test(__attribute__((unused)) void *arg)
134 {
135         void *obj_table[MAX_KEEP];
136         unsigned i, idx;
137         unsigned lcore_id = rte_lcore_id();
138         int ret;
139         uint64_t start_cycles, end_cycles;
140         uint64_t time_diff = 0, hz = rte_get_hpet_hz();
141
142         /* n_get_bulk and n_put_bulk must be divisors of n_keep */
143         if (((n_keep / n_get_bulk) * n_get_bulk) != n_keep)
144                 return -1;
145         if (((n_keep / n_put_bulk) * n_put_bulk) != n_keep)
146                 return -1;
147
148         stats[lcore_id].enq_count = 0;
149
150         /* wait synchro for slaves */
151         if (lcore_id != rte_get_master_lcore())
152                 while (rte_atomic32_read(&synchro) == 0);
153
154         start_cycles = rte_get_hpet_cycles();
155
156         while (time_diff/hz < TIME_S) {
157                 for (i = 0; likely(i < (N/n_keep)); i++) {
158                         /* get n_keep objects by bulk of n_bulk */
159                         idx = 0;
160                         while (idx < n_keep) {
161                                 ret = rte_mempool_get_bulk(mp, &obj_table[idx],
162                                                            n_get_bulk);
163                                 if (unlikely(ret < 0)) {
164                                         rte_mempool_dump(mp);
165                                         rte_ring_dump(mp->ring);
166                                         /* in this case, objects are lost... */
167                                         return -1;
168                                 }
169                                 idx += n_get_bulk;
170                         }
171
172                         /* put the objects back */
173                         idx = 0;
174                         while (idx < n_keep) {
175                                 rte_mempool_put_bulk(mp, &obj_table[idx],
176                                                      n_put_bulk);
177                                 idx += n_put_bulk;
178                         }
179                 }
180                 end_cycles = rte_get_hpet_cycles();
181                 time_diff = end_cycles - start_cycles;
182                 stats[lcore_id].enq_count += N;
183         }
184
185         return 0;
186 }
187
188 /* launch all the per-lcore test, and display the result */
189 static int
190 launch_cores(unsigned cores)
191 {
192         unsigned lcore_id;
193         unsigned rate;
194         int ret;
195         unsigned cores_save = cores;
196
197         rte_atomic32_set(&synchro, 0);
198
199         /* reset stats */
200         memset(stats, 0, sizeof(stats));
201
202         printf("mempool_autotest cache=%u cores=%u n_get_bulk=%u "
203                "n_put_bulk=%u n_keep=%u ",
204                (unsigned) mp->cache_size, cores, n_get_bulk, n_put_bulk, n_keep);
205
206         if (rte_mempool_count(mp) != MEMPOOL_SIZE) {
207                 printf("mempool is not full\n");
208                 return -1;
209         }
210
211         RTE_LCORE_FOREACH_SLAVE(lcore_id) {
212                 if (cores == 1)
213                         break;
214                 cores--;
215                 rte_eal_remote_launch(per_lcore_mempool_test,
216                                       NULL, lcore_id);
217         }
218
219         /* start synchro and launch test on master */
220         rte_atomic32_set(&synchro, 1);
221
222         ret = per_lcore_mempool_test(NULL);
223
224         cores = cores_save;
225         RTE_LCORE_FOREACH_SLAVE(lcore_id) {
226                 if (cores == 1)
227                         break;
228                 cores--;
229                 if (rte_eal_wait_lcore(lcore_id) < 0)
230                         ret = -1;
231         }
232
233         if (ret < 0) {
234                 printf("per-lcore test returned -1\n");
235                 return -1;
236         }
237
238         rate = 0;
239         for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++)
240                 rate += (stats[lcore_id].enq_count / TIME_S);
241
242         printf("rate_persec=%u\n", rate);
243
244         return 0;
245 }
246
247 /* for a given number of core, launch all test cases */
248 static int
249 do_one_mempool_test(unsigned cores)
250 {
251         unsigned bulk_tab_get[] = { 1, 4, 32, 0 };
252         unsigned bulk_tab_put[] = { 1, 4, 32, 0 };
253         unsigned keep_tab[] = { 32, 128, 0 };
254         unsigned *get_bulk_ptr;
255         unsigned *put_bulk_ptr;
256         unsigned *keep_ptr;
257         int ret;
258
259         for (get_bulk_ptr = bulk_tab_get; *get_bulk_ptr; get_bulk_ptr++) {
260                 for (put_bulk_ptr = bulk_tab_put; *put_bulk_ptr; put_bulk_ptr++) {
261                         for (keep_ptr = keep_tab; *keep_ptr; keep_ptr++) {
262
263                                 n_get_bulk = *get_bulk_ptr;
264                                 n_put_bulk = *put_bulk_ptr;
265                                 n_keep = *keep_ptr;
266                                 ret = launch_cores(cores);
267
268                                 if (ret < 0)
269                                         return -1;
270                         }
271                 }
272         }
273         return 0;
274 }
275
276
277 /*
278  * save the object number in the first 4 bytes of object data. All
279  * other bytes are set to 0.
280  */
281 static void
282 my_obj_init(struct rte_mempool *mp, __attribute__((unused)) void *arg,
283             void *obj, unsigned i)
284 {
285         uint32_t *objnum = obj;
286         memset(obj, 0, mp->elt_size);
287         *objnum = i;
288 }
289
290 /* basic tests (done on one core) */
291 static int
292 test_mempool_basic(void)
293 {
294         uint32_t *objnum;
295         void **objtable;
296         void *obj, *obj2;
297         char *obj_data;
298         int ret = 0;
299         unsigned i, j;
300         unsigned old_bulk_count;
301
302         /* dump the mempool status */
303         rte_mempool_dump(mp);
304         old_bulk_count = rte_mempool_get_bulk_count(mp);
305         rte_mempool_dump(mp);
306         if (rte_mempool_set_bulk_count(mp, 0) == 0)
307                 return -1;
308         if (rte_mempool_get_bulk_count(mp) == 0)
309                 return -1;
310         if (rte_mempool_set_bulk_count(mp, 2) < 0)
311                 return -1;
312         if (rte_mempool_get_bulk_count(mp) != 2)
313                 return -1;
314         rte_mempool_dump(mp);
315         if (rte_mempool_set_bulk_count(mp, old_bulk_count) < 0)
316                 return -1;
317         if (rte_mempool_get_bulk_count(mp) != old_bulk_count)
318                 return -1;
319         rte_mempool_dump(mp);
320
321         printf("get an object\n");
322         if (rte_mempool_get(mp, &obj) < 0)
323                 return -1;
324         rte_mempool_dump(mp);
325
326         printf("put the object back\n");
327         rte_mempool_put(mp, obj);
328         rte_mempool_dump(mp);
329
330         printf("get 2 objects\n");
331         if (rte_mempool_get(mp, &obj) < 0)
332                 return -1;
333         if (rte_mempool_get(mp, &obj2) < 0) {
334                 rte_mempool_put(mp, obj);
335                 return -1;
336         }
337         rte_mempool_dump(mp);
338
339         printf("put the objects back\n");
340         rte_mempool_put(mp, obj);
341         rte_mempool_put(mp, obj2);
342         rte_mempool_dump(mp);
343
344         /*
345          * get many objects: we cannot get them all because the cache
346          * on other cores may not be empty.
347          */
348         objtable = malloc(MEMPOOL_SIZE * sizeof(void *));
349         if (objtable == NULL) {
350                 return -1;
351         }
352
353         for (i=0; i<MEMPOOL_SIZE; i++) {
354                 if (rte_mempool_get(mp, &objtable[i]) < 0)
355                         break;
356         }
357
358         /*
359          * for each object, check that its content was not modified,
360          * and put objects back in pool
361          */
362         while (i--) {
363                 obj = objtable[i];
364                 obj_data = obj;
365                 objnum = obj;
366                 if (*objnum > MEMPOOL_SIZE) {
367                         printf("bad object number\n");
368                         ret = -1;
369                         break;
370                 }
371                 for (j=sizeof(*objnum); j<mp->elt_size; j++) {
372                         if (obj_data[j] != 0)
373                                 ret = -1;
374                 }
375
376                 rte_mempool_put(mp, objtable[i]);
377         }
378
379         free(objtable);
380         if (ret == -1)
381                 printf("objects were modified!\n");
382
383         return ret;
384 }
385
386 static int test_mempool_creation_with_exceeded_cache_size(void)
387 {
388         struct rte_mempool *mp_cov;
389
390         mp_cov = rte_mempool_create("test_mempool_creation_with_exceeded_cache_size", MEMPOOL_SIZE,
391                                               MEMPOOL_ELT_SIZE,
392                                               RTE_MEMPOOL_CACHE_MAX_SIZE + 32, 0,
393                                               NULL, NULL,
394                                               my_obj_init, NULL,
395                                               SOCKET_ID_ANY, 0);
396         if(NULL != mp_cov) {
397                 return -1;
398         }
399
400         return 0;
401 }
402
403 static struct rte_mempool *mp_spsc;
404 static rte_spinlock_t scsp_spinlock;
405 static void *scsp_obj_table[MAX_KEEP];
406
407 /*
408  * single producer function
409  */
410 static int test_mempool_single_producer(void)
411 {
412         unsigned int i;
413         void *obj = NULL;
414         uint64_t start_cycles, end_cycles;
415         uint64_t duration = rte_get_hpet_hz() * 8;
416
417         start_cycles = rte_get_hpet_cycles();
418         while (1) {
419                 end_cycles = rte_get_hpet_cycles();
420                 /* duration uses up, stop producing */
421                 if (start_cycles + duration < end_cycles)
422                         break;
423                 rte_spinlock_lock(&scsp_spinlock);
424                 for (i = 0; i < MAX_KEEP; i ++) {
425                         if (NULL != scsp_obj_table[i])
426                                 obj = scsp_obj_table[i];
427                                 break;
428                 }
429                 rte_spinlock_unlock(&scsp_spinlock);
430                 if (i >= MAX_KEEP) {
431                         continue;
432                 }
433                 if (rte_mempool_from_obj(obj) != mp_spsc) {
434                         printf("test_mempool_single_producer there is an obj not owned by this mempool\n");
435                         return -1;
436                 }
437                 rte_mempool_sp_put(mp_spsc, obj);
438                 rte_spinlock_lock(&scsp_spinlock);
439                 scsp_obj_table[i] = NULL;
440                 rte_spinlock_unlock(&scsp_spinlock);
441         }
442
443         return 0;
444 }
445
446 /*
447  * single consumer function
448  */
449 static int test_mempool_single_consumer(void)
450 {
451         unsigned int i;
452         void * obj;
453         uint64_t start_cycles, end_cycles;
454         uint64_t duration = rte_get_hpet_hz() * 5;
455
456         start_cycles = rte_get_hpet_cycles();
457         while (1) {
458                 end_cycles = rte_get_hpet_cycles();
459                 /* duration uses up, stop consuming */
460                 if (start_cycles + duration < end_cycles)
461                         break;
462                 rte_spinlock_lock(&scsp_spinlock);
463                 for (i = 0; i < MAX_KEEP; i ++) {
464                         if (NULL == scsp_obj_table[i])
465                                 break;
466                 }
467                 rte_spinlock_unlock(&scsp_spinlock);
468                 if (i >= MAX_KEEP)
469                         continue;
470                 if (rte_mempool_sc_get(mp_spsc, &obj) < 0)
471                         break;
472                 rte_spinlock_lock(&scsp_spinlock);
473                 scsp_obj_table[i] = obj;
474                 rte_spinlock_unlock(&scsp_spinlock);
475         }
476
477         return 0;
478 }
479
480 /*
481  * test function for mempool test based on singple consumer and single producer, can run on one lcore only
482  */
483 static int test_mempool_launch_single_consumer(__attribute__((unused)) void *arg)
484 {
485         return test_mempool_single_consumer();
486 }
487
488 static void my_mp_init(struct rte_mempool * mp, __attribute__((unused)) void * arg)
489 {
490         printf("mempool name is %s\n", mp->name);
491         /* nothing to be implemented here*/
492         return ;
493 }
494
495 /*
496  * it tests the mempool operations based on singple producer and single consumer
497  */
498 static int
499 test_mempool_sp_sc(void)
500 {
501         int ret = 0;
502         unsigned lcore_id = rte_lcore_id();
503         unsigned lcore_next;
504
505         /* create a mempool with single producer/consumer ring */
506         if (NULL == mp_spsc) {
507                 mp_spsc = rte_mempool_create("test_mempool_sp_sc", MEMPOOL_SIZE,
508                                                 MEMPOOL_ELT_SIZE, 0, 0,
509                                                 my_mp_init, NULL,
510                                                 my_obj_init, NULL,
511                                                 SOCKET_ID_ANY, MEMPOOL_F_NO_CACHE_ALIGN | MEMPOOL_F_SP_PUT | MEMPOOL_F_SC_GET);
512                 if (NULL == mp_spsc) {
513                         return -1;
514                 }
515         }
516         if (rte_mempool_lookup("test_mempool_sp_sc") != mp_spsc) {
517                 printf("Cannot lookup mempool from its name\n");
518                 return -1;
519         }
520         lcore_next = rte_get_next_lcore(lcore_id, 0, 1);
521         if (RTE_MAX_LCORE <= lcore_next)
522                 return -1;
523         if (rte_eal_lcore_role(lcore_next) != ROLE_RTE)
524                 return -1;
525         rte_spinlock_init(&scsp_spinlock);
526         memset(scsp_obj_table, 0, sizeof(scsp_obj_table));
527         rte_eal_remote_launch(test_mempool_launch_single_consumer, NULL, lcore_next);
528         if(test_mempool_single_producer() < 0)
529                 ret = -1;
530
531         if(rte_eal_wait_lcore(lcore_next) < 0)
532                 ret = -1;
533
534         return ret;
535 }
536
537 /*
538  * it tests some more basic of mempool
539  */
540 static int
541 test_mempool_basic_ex(struct rte_mempool * mp)
542 {
543         unsigned i;
544         void **obj;
545         void *err_obj;
546         int ret = -1;
547
548         if (mp == NULL)
549                 return ret;
550
551         obj = (void **)rte_zmalloc("test_mempool_basic_ex", (MEMPOOL_SIZE * sizeof(void *)), 0);
552         if (obj == NULL) {
553                 printf("test_mempool_basic_ex fail to rte_malloc\n");
554                 return ret;
555         }
556         printf("test_mempool_basic_ex now mempool (%s) has %u free entries\n", mp->name, rte_mempool_free_count(mp));
557         if (rte_mempool_full(mp) != 1) {
558                 printf("test_mempool_basic_ex the mempool is not full but it should be\n");
559                 goto fail_mp_basic_ex;
560         }
561
562         for (i = 0; i < MEMPOOL_SIZE; i ++) {
563                 if (rte_mempool_mc_get(mp, &obj[i]) < 0) {
564                         printf("fail_mp_basic_ex fail to get mempool object for [%u]\n", i);
565                         goto fail_mp_basic_ex;
566                 }
567         }
568         if (rte_mempool_mc_get(mp, &err_obj) == 0) {
569                 printf("test_mempool_basic_ex get an impossible obj from mempool\n");
570                 goto fail_mp_basic_ex;
571         }
572         printf("number: %u\n", i);
573         if (rte_mempool_empty(mp) != 1) {
574                 printf("test_mempool_basic_ex the mempool is not empty but it should be\n");
575                 goto fail_mp_basic_ex;
576         }
577
578         for (i = 0; i < MEMPOOL_SIZE; i ++) {
579                 rte_mempool_mp_put(mp, obj[i]);
580         }
581         if (rte_mempool_full(mp) != 1) {
582                 printf("test_mempool_basic_ex the mempool is not full but it should be\n");
583                 goto fail_mp_basic_ex;
584         }
585
586         ret = 0;
587
588 fail_mp_basic_ex:
589         if (obj != NULL)
590                 rte_free((void *)obj);
591
592         return ret;
593 }
594
595 static int
596 test_mempool_same_name_twice_creation(void)
597 {
598         struct rte_mempool *mp_tc;
599
600         mp_tc = rte_mempool_create("test_mempool_same_name_twice_creation", MEMPOOL_SIZE,
601                                                 MEMPOOL_ELT_SIZE, 0, 0,
602                                                 NULL, NULL,
603                                                 NULL, NULL,
604                                                 SOCKET_ID_ANY, 0);
605         if (NULL == mp_tc)
606                 return -1;
607
608         mp_tc = rte_mempool_create("test_mempool_same_name_twice_creation", MEMPOOL_SIZE,
609                                                 MEMPOOL_ELT_SIZE, 0, 0,
610                                                 NULL, NULL,
611                                                 NULL, NULL,
612                                                 SOCKET_ID_ANY, 0);
613         if (NULL != mp_tc)
614                 return -1;
615
616         return 0;
617 }
618
619 int
620 test_mempool(void)
621 {
622         rte_atomic32_init(&synchro);
623
624         /* create a mempool (without cache) */
625         if (mp_nocache == NULL)
626                 mp_nocache = rte_mempool_create("test_nocache", MEMPOOL_SIZE,
627                                                 MEMPOOL_ELT_SIZE, 0, 0,
628                                                 NULL, NULL,
629                                                 my_obj_init, NULL,
630                                                 SOCKET_ID_ANY, 0);
631         if (mp_nocache == NULL)
632                 return -1;
633
634         /* create a mempool (with cache) */
635         if (mp_cache == NULL)
636                 mp_cache = rte_mempool_create("test_cache", MEMPOOL_SIZE,
637                                               MEMPOOL_ELT_SIZE,
638                                               RTE_MEMPOOL_CACHE_MAX_SIZE, 0,
639                                               NULL, NULL,
640                                               my_obj_init, NULL,
641                                               SOCKET_ID_ANY, 0);
642         if (mp_cache == NULL)
643                 return -1;
644
645
646         /* retrieve the mempool from its name */
647         if (rte_mempool_lookup("test_nocache") != mp_nocache) {
648                 printf("Cannot lookup mempool from its name\n");
649                 return -1;
650         }
651
652         rte_mempool_list_dump();
653
654         /* basic tests without cache */
655         mp = mp_nocache;
656         if (test_mempool_basic() < 0)
657                 return -1;
658
659         /* basic tests with cache */
660         mp = mp_cache;
661         if (test_mempool_basic() < 0)
662                 return -1;
663
664         /* more basic tests without cache */
665         if (test_mempool_basic_ex(mp_nocache) < 0)
666                 return -1;
667
668         /* performance test with 1, 2 and max cores */
669         printf("start performance test (without cache)\n");
670         mp = mp_nocache;
671
672         if (do_one_mempool_test(1) < 0)
673                 return -1;
674
675         if (do_one_mempool_test(2) < 0)
676                 return -1;
677
678         if (do_one_mempool_test(rte_lcore_count()) < 0)
679                 return -1;
680
681         /* performance test with 1, 2 and max cores */
682         printf("start performance test (with cache)\n");
683         mp = mp_cache;
684
685         if (do_one_mempool_test(1) < 0)
686                 return -1;
687
688         if (do_one_mempool_test(2) < 0)
689                 return -1;
690
691         if (do_one_mempool_test(rte_lcore_count()) < 0)
692                 return -1;
693
694         /* mempool operation test based on single producer and single comsumer */
695         if (test_mempool_sp_sc() < 0)
696                 return -1;
697
698         if (test_mempool_creation_with_exceeded_cache_size() < 0)
699                 return -1;
700
701         if (test_mempool_same_name_twice_creation() < 0)
702                 return -1;
703
704         rte_mempool_list_dump();
705
706         return 0;
707 }