1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2014 Intel Corporation.
3 * Copyright(c) 2014 6WIND S.A.
13 #ifdef RTE_EXEC_ENV_WINDOWS
15 test_missing_c_flag(void)
17 printf("missing_c_flag not supported on Windows, skipping test\n");
22 test_main_lcore_flag(void)
24 printf("main_lcore_flag not supported on Windows, skipping test\n");
29 test_invalid_n_flag(void)
31 printf("invalid_n_flag not supported on Windows, skipping test\n");
36 test_no_hpet_flag(void)
38 printf("no_hpet_flag not supported on Windows, skipping test\n");
43 test_no_huge_flag(void)
45 printf("no_huge_flag not supported on Windows, skipping test\n");
52 printf("allow_flag not supported on Windows, skipping test\n");
57 test_invalid_b_flag(void)
59 printf("invalid_b_flag not supported on Windows, skipping test\n");
64 test_invalid_vdev_flag(void)
66 printf("invalid_vdev_flag not supported on Windows, skipping test\n");
71 test_invalid_r_flag(void)
73 printf("invalid_r_flag not supported on Windows, skipping test\n");
78 test_memory_flags(void)
80 printf("memory_flags not supported on Windows, skipping test\n");
85 test_file_prefix(void)
87 printf("file_prefix not supported on Windows, skipping test\n");
94 printf("misc_flags not supported on Windows, skipping test\n");
105 #include <sys/file.h>
106 #include <sys/stat.h>
107 #include <sys/wait.h>
111 #include <rte_lcore.h>
112 #include <rte_debug.h>
113 #include <rte_string_fns.h>
117 #define DEFAULT_MEM_SIZE "18"
118 #define mp_flag "--proc-type=secondary"
119 #define no_hpet "--no-hpet"
120 #define no_huge "--no-huge"
121 #define no_shconf "--no-shconf"
122 #define allow "--allow"
123 #define vdev "--vdev"
124 #define memtest "memtest"
125 #define memtest1 "memtest1"
126 #define memtest2 "memtest2"
127 #define SOCKET_MEM_STRLEN (RTE_MAX_NUMA_NODES * 20)
128 #define launch_proc(ARGV) process_dup(ARGV, RTE_DIM(ARGV), __func__)
130 enum hugepage_action {
131 HUGEPAGE_CHECK_EXISTS = 0,
132 HUGEPAGE_CHECK_LOCKED,
137 /* if string contains a hugepage path */
139 get_hugepage_path(char * src, int src_len, char * dst, int dst_len)
142 char *tokens[NUM_TOKENS];
144 /* if we couldn't properly split the string */
145 if (rte_strsplit(src, src_len, tokens, NUM_TOKENS, ' ') < NUM_TOKENS)
148 if (strncmp(tokens[2], "hugetlbfs", sizeof("hugetlbfs")) == 0) {
149 strlcpy(dst, tokens[1], dst_len);
156 * Cycles through hugepage directories and looks for hugepage
157 * files associated with a given prefix. Depending on value of
158 * action, the hugepages are checked if they exist, checked if
159 * they can be locked, or are simply deleted.
161 * Returns 1 if it finds at least one hugepage matching the action
162 * Returns 0 if no matching hugepages were found
163 * Returns -1 if it encounters an error
166 process_hugefiles(const char * prefix, enum hugepage_action action)
168 FILE * hugedir_handle = NULL;
169 DIR * hugepage_dir = NULL;
170 struct dirent *dirent = NULL;
172 char hugefile_prefix[PATH_MAX] = {0};
173 char hugedir[PATH_MAX] = {0};
174 char line[PATH_MAX] = {0};
176 int fd, lck_result, result = 0;
178 const int prefix_len = snprintf(hugefile_prefix,
179 sizeof(hugefile_prefix), "%smap_", prefix);
180 if (prefix_len <= 0 || prefix_len >= (int)sizeof(hugefile_prefix)
181 || prefix_len >= (int)sizeof(dirent->d_name)) {
182 printf("Error creating hugefile filename prefix\n");
186 /* get hugetlbfs mountpoints from /proc/mounts */
187 hugedir_handle = fopen("/proc/mounts", "r");
189 if (hugedir_handle == NULL) {
190 printf("Error parsing /proc/mounts!\n");
194 /* read and parse script output */
195 while (fgets(line, sizeof(line), hugedir_handle) != NULL) {
197 /* check if we have a hugepage filesystem path */
198 if (!get_hugepage_path(line, sizeof(line), hugedir, sizeof(hugedir)))
201 /* check if directory exists */
202 if ((hugepage_dir = opendir(hugedir)) == NULL) {
203 fclose(hugedir_handle);
204 printf("Error reading %s: %s\n", hugedir, strerror(errno));
208 while ((dirent = readdir(hugepage_dir)) != NULL) {
209 if (memcmp(dirent->d_name, hugefile_prefix, prefix_len) != 0)
213 case HUGEPAGE_CHECK_EXISTS:
215 /* file exists, return */
216 closedir(hugepage_dir);
221 case HUGEPAGE_DELETE:
223 char file_path[PATH_MAX] = {0};
225 snprintf(file_path, sizeof(file_path),
226 "%s/%s", hugedir, dirent->d_name);
229 if (remove(file_path) < 0) {
230 printf("Error deleting %s - %s!\n",
231 dirent->d_name, strerror(errno));
232 closedir(hugepage_dir);
239 case HUGEPAGE_CHECK_LOCKED:
241 /* try and lock the file */
242 fd = openat(dirfd(hugepage_dir), dirent->d_name, O_RDONLY);
244 /* this shouldn't happen */
246 printf("Error opening %s - %s!\n",
247 dirent->d_name, strerror(errno));
248 closedir(hugepage_dir);
253 /* non-blocking lock */
254 lck_result = flock(fd, LOCK_EX | LOCK_NB);
256 /* if lock succeeds, there's something wrong */
257 if (lck_result != -1) {
260 /* unlock the resulting lock */
263 closedir(hugepage_dir);
270 /* shouldn't happen */
275 } /* read hugepage directory */
276 closedir(hugepage_dir);
277 } /* read /proc/mounts */
279 fclose(hugedir_handle);
283 #ifdef RTE_EXEC_ENV_LINUX
285 * count the number of "node*" files in /sys/devices/system/node/
288 get_number_of_sockets(void)
290 struct dirent *dirent = NULL;
291 const char * nodedir = "/sys/devices/system/node/";
295 /* check if directory exists */
296 if ((dir = opendir(nodedir)) == NULL) {
297 /* if errno==ENOENT this means we don't have NUMA support */
298 if (errno == ENOENT) {
299 printf("No NUMA nodes detected: assuming 1 available socket\n");
302 printf("Error opening %s: %s\n", nodedir, strerror(errno));
306 while ((dirent = readdir(dir)) != NULL)
307 if (strncmp(dirent->d_name, "node", sizeof("node") - 1) == 0)
316 * Test that the app doesn't run with invalid allow option.
317 * Final tests ensures it does run with valid options as sanity check (one
318 * test for with Domain+BDF, second for just with BDF)
321 test_allow_flag(void)
324 #ifdef RTE_EXEC_ENV_FREEBSD
325 /* BSD target doesn't support prefixes at this point */
326 const char * prefix = "";
328 char prefix[PATH_MAX], tmp[PATH_MAX];
329 if (get_current_prefix(tmp, sizeof(tmp)) == NULL) {
330 printf("Error - unable to get current prefix!\n");
333 snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp);
336 const char *wlinval[][7] = {
337 {prgname, prefix, mp_flag,
338 allow, "error", "", ""},
339 {prgname, prefix, mp_flag,
340 allow, "0:0:0", "", ""},
341 {prgname, prefix, mp_flag,
342 allow, "0:error:0.1", "", ""},
343 {prgname, prefix, mp_flag,
344 allow, "0:0:0.1error", "", ""},
345 {prgname, prefix, mp_flag,
346 allow, "error0:0:0.1", "", ""},
347 {prgname, prefix, mp_flag,
348 allow, "0:0:0.1.2", "", ""},
350 /* Test with valid allow option */
351 const char *wlval1[] = {prgname, prefix, mp_flag,
352 allow, "00FF:09:0B.3"};
353 const char *wlval2[] = {prgname, prefix, mp_flag,
354 allow, "09:0B.3", allow, "0a:0b.1"};
355 const char *wlval3[] = {prgname, prefix, mp_flag,
356 allow, "09:0B.3,type=test",
357 allow, "08:00.1,type=normal",
360 for (i = 0; i < RTE_DIM(wlinval); i++) {
361 if (launch_proc(wlinval[i]) == 0) {
362 printf("Error - process did run ok with invalid "
363 "allow parameter\n");
367 if (launch_proc(wlval1) != 0 ) {
368 printf("Error - process did not run ok with valid allow\n");
371 if (launch_proc(wlval2) != 0 ) {
372 printf("Error - process did not run ok with valid allow value set\n");
375 if (launch_proc(wlval3) != 0 ) {
376 printf("Error - process did not run ok with valid allow + args\n");
384 * Test that the app doesn't run with invalid blocklist option.
385 * Final test ensures it does run with valid options as sanity check
388 test_invalid_b_flag(void)
390 #ifdef RTE_EXEC_ENV_FREEBSD
391 /* BSD target doesn't support prefixes at this point */
392 const char * prefix = "";
394 char prefix[PATH_MAX], tmp[PATH_MAX];
395 if (get_current_prefix(tmp, sizeof(tmp)) == NULL) {
396 printf("Error - unable to get current prefix!\n");
399 snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp);
402 const char *blinval[][5] = {
403 {prgname, prefix, mp_flag, "-b", "error"},
404 {prgname, prefix, mp_flag, "-b", "0:0:0"},
405 {prgname, prefix, mp_flag, "-b", "0:error:0.1"},
406 {prgname, prefix, mp_flag, "-b", "0:0:0.1error"},
407 {prgname, prefix, mp_flag, "-b", "error0:0:0.1"},
408 {prgname, prefix, mp_flag, "-b", "0:0:0.1.2"},
410 /* Test with valid blocklist option */
411 const char *blval[] = {prgname, prefix, mp_flag,
416 for (i = 0; i != RTE_DIM(blinval); i++) {
417 if (launch_proc(blinval[i]) == 0) {
418 printf("Error - process did run ok with invalid "
419 "blocklist parameter\n");
423 if (launch_proc(blval) != 0) {
424 printf("Error - process did not run ok with valid blocklist value\n");
431 * Test that the app doesn't run with invalid vdev option.
432 * Final test ensures it does run with valid options as sanity check
435 test_invalid_vdev_flag(void)
438 #ifdef RTE_EXEC_ENV_FREEBSD
439 /* BSD target doesn't support prefixes at this point, and we also need to
440 * run another primary process here */
441 const char * prefix = no_shconf;
443 const char * prefix = "--file-prefix=vdev";
446 /* Test with invalid vdev option */
447 const char *vdevinval[] = {prgname, prefix, no_huge,
450 /* Test with valid vdev option */
451 const char *vdevval1[] = {prgname, prefix, no_huge,
454 const char *vdevval2[] = {prgname, prefix, no_huge,
455 vdev, "net_ring0,args=test"};
457 const char *vdevval3[] = {prgname, prefix, no_huge,
458 vdev, "net_ring0,nodeaction=r1:0:CREATE"};
460 if (launch_proc(vdevinval) == 0) {
461 printf("Error - process did run ok with invalid "
466 if (launch_proc(vdevval1) != 0) {
467 printf("Error - process did not run ok with valid vdev value\n");
471 if (launch_proc(vdevval2) != 0) {
472 printf("Error - process did not run ok with valid vdev value,"
473 "with dummy args\n");
477 if (launch_proc(vdevval3) != 0) {
478 printf("Error - process did not run ok with valid vdev value,"
479 "with valid args\n");
489 * Test that the app doesn't run with invalid -r option.
492 test_invalid_r_flag(void)
494 #ifdef RTE_EXEC_ENV_FREEBSD
495 /* BSD target doesn't support prefixes at this point */
496 const char * prefix = "";
498 char prefix[PATH_MAX], tmp[PATH_MAX];
499 if (get_current_prefix(tmp, sizeof(tmp)) == NULL) {
500 printf("Error - unable to get current prefix!\n");
503 snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp);
506 const char *rinval[][5] = {
507 {prgname, prefix, mp_flag, "-r", "error"},
508 {prgname, prefix, mp_flag, "-r", "0"},
509 {prgname, prefix, mp_flag, "-r", "-1"},
510 {prgname, prefix, mp_flag, "-r", "17"},
512 /* Test with valid blocklist option */
513 const char *rval[] = {prgname, prefix, mp_flag, "-r", "16"};
517 for (i = 0; i != RTE_DIM(rinval); i++) {
518 if (launch_proc(rinval[i]) == 0) {
519 printf("Error - process did run ok with invalid "
520 "-r (rank) parameter\n");
524 if (launch_proc(rval) != 0) {
525 printf("Error - process did not run ok with valid -r (rank) value\n");
532 * Test that the app doesn't run without the coremask/corelist flags. In all cases
533 * should give an error and fail to run
536 test_missing_c_flag(void)
538 #ifdef RTE_EXEC_ENV_FREEBSD
539 /* BSD target doesn't support prefixes at this point */
540 const char * prefix = "";
542 char prefix[PATH_MAX], tmp[PATH_MAX];
543 if (get_current_prefix(tmp, sizeof(tmp)) == NULL) {
544 printf("Error - unable to get current prefix!\n");
547 snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp);
550 /* -c flag but no coremask value */
551 const char *argv1[] = { prgname, prefix, mp_flag, "-c"};
552 /* No -c, -l or --lcores flag at all */
553 const char *argv2[] = { prgname, prefix, mp_flag};
554 /* bad coremask value */
555 const char *argv3[] = { prgname, prefix, mp_flag,
557 /* sanity check of tests - valid coremask value */
558 const char *argv4[] = { prgname, prefix, mp_flag,
560 /* -l flag but no corelist value */
561 const char *argv5[] = { prgname, prefix, mp_flag,
563 const char *argv6[] = { prgname, prefix, mp_flag,
565 /* bad corelist values */
566 const char *argv7[] = { prgname, prefix, mp_flag,
568 const char *argv8[] = { prgname, prefix, mp_flag,
570 const char *argv9[] = { prgname, prefix, mp_flag,
572 const char *argv10[] = { prgname, prefix, mp_flag,
574 /* core number is negative value */
575 const char * const argv11[] = { prgname, prefix, mp_flag,
577 const char * const argv12[] = { prgname, prefix, mp_flag,
579 /* core number is maximum value */
580 const char * const argv13[] = { prgname, prefix, mp_flag,
581 "-l", RTE_STR(RTE_MAX_LCORE) };
582 const char * const argv14[] = { prgname, prefix, mp_flag,
583 "-l", "1-"RTE_STR(RTE_MAX_LCORE) };
584 /* sanity check test - valid corelist value */
585 const char * const argv15[] = { prgname, prefix, mp_flag,
588 /* --lcores flag but no lcores value */
589 const char * const argv16[] = { prgname, prefix, mp_flag,
591 const char * const argv17[] = { prgname, prefix, mp_flag,
593 /* bad lcores value */
594 const char * const argv18[] = { prgname, prefix, mp_flag,
595 "--lcores", "1-3-5" };
596 const char * const argv19[] = { prgname, prefix, mp_flag,
597 "--lcores", "0-1,,2" };
598 const char * const argv20[] = { prgname, prefix, mp_flag,
599 "--lcores", "0-,1" };
600 const char * const argv21[] = { prgname, prefix, mp_flag,
601 "--lcores", "(0-,2-4)" };
602 const char * const argv22[] = { prgname, prefix, mp_flag,
603 "--lcores", "(-1,2)" };
604 const char * const argv23[] = { prgname, prefix, mp_flag,
605 "--lcores", "(2-4)@(2-4-6)" };
606 const char * const argv24[] = { prgname, prefix, mp_flag,
607 "--lcores", "(a,2)" };
608 const char * const argv25[] = { prgname, prefix, mp_flag,
609 "--lcores", "1-3@(1,3)" };
610 const char * const argv26[] = { prgname, prefix, mp_flag,
611 "--lcores", "3@((1,3)" };
612 const char * const argv27[] = { prgname, prefix, mp_flag,
613 "--lcores", "(4-7)=(1,3)" };
614 const char * const argv28[] = { prgname, prefix, mp_flag,
615 "--lcores", "[4-7]@(1,3)" };
616 /* sanity check of tests - valid lcores value */
617 const char * const argv29[] = { prgname, prefix, mp_flag,
619 "0-1,2@(5-7),(3-5)@(0,2),(0,6),7"};
620 /* check an invalid cpu value >= CPU_SETSIZE */
621 const char * const argv30[] = { prgname, prefix, mp_flag,
622 "--lcores", "3@" RTE_STR(CPU_SETSIZE) };
624 if (launch_proc(argv2) != 0) {
626 "process did not run ok when missing -c flag\n");
630 if (launch_proc(argv1) == 0
631 || launch_proc(argv3) == 0) {
633 "process ran without error with invalid -c flag\n");
636 if (launch_proc(argv4) != 0) {
638 "process did not run ok with valid coremask value\n");
643 if (launch_proc(argv5) == 0
644 || launch_proc(argv6) == 0
645 || launch_proc(argv7) == 0
646 || launch_proc(argv8) == 0
647 || launch_proc(argv9) == 0
648 || launch_proc(argv10) == 0
649 || launch_proc(argv11) == 0
650 || launch_proc(argv12) == 0
651 || launch_proc(argv13) == 0
652 || launch_proc(argv14) == 0) {
654 "process ran without error with invalid -l flag\n");
657 if (rte_lcore_is_enabled(0) && rte_lcore_is_enabled(1) &&
658 rte_lcore_is_enabled(2) && rte_lcore_is_enabled(3) &&
659 launch_proc(argv15) != 0) {
661 "process did not run ok with valid corelist value\n");
665 /* start --lcores tests */
666 if (launch_proc(argv16) == 0 || launch_proc(argv17) == 0 ||
667 launch_proc(argv18) == 0 || launch_proc(argv19) == 0 ||
668 launch_proc(argv20) == 0 || launch_proc(argv21) == 0 ||
669 launch_proc(argv22) == 0 || launch_proc(argv23) == 0 ||
670 launch_proc(argv24) == 0 || launch_proc(argv25) == 0 ||
671 launch_proc(argv26) == 0 || launch_proc(argv27) == 0 ||
672 launch_proc(argv28) == 0 || launch_proc(argv30) == 0) {
674 "process ran without error with invalid --lcore flag\n");
678 if (rte_lcore_is_enabled(0) && rte_lcore_is_enabled(1) &&
679 rte_lcore_is_enabled(2) && rte_lcore_is_enabled(3) &&
680 rte_lcore_is_enabled(3) && rte_lcore_is_enabled(5) &&
681 rte_lcore_is_enabled(4) && rte_lcore_is_enabled(7) &&
682 launch_proc(argv29) != 0) {
684 "process did not run ok with valid corelist value\n");
692 * Test --main-lcore option with matching coremask
695 test_main_lcore_flag(void)
697 #ifdef RTE_EXEC_ENV_FREEBSD
698 /* BSD target doesn't support prefixes at this point */
699 const char *prefix = "";
701 char prefix[PATH_MAX], tmp[PATH_MAX];
702 if (get_current_prefix(tmp, sizeof(tmp)) == NULL) {
703 printf("Error - unable to get current prefix!\n");
706 snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp);
709 if (!rte_lcore_is_enabled(0) || !rte_lcore_is_enabled(1))
712 /* --main-lcore flag but no value */
713 const char *argv1[] = { prgname, prefix, mp_flag,
714 "-c", "3", "--main-lcore"};
715 /* --main-lcore flag with invalid value */
716 const char *argv2[] = { prgname, prefix, mp_flag,
717 "-c", "3", "--main-lcore", "-1"};
718 const char *argv3[] = { prgname, prefix, mp_flag,
719 "-c", "3", "--main-lcore", "X"};
720 /* main lcore not in coremask */
721 const char *argv4[] = { prgname, prefix, mp_flag,
722 "-c", "3", "--main-lcore", "2"};
724 const char *argv5[] = { prgname, prefix, mp_flag,
725 "-c", "3", "--main-lcore", "1"};
726 /* valid value set before coremask */
727 const char *argv6[] = { prgname, prefix, mp_flag,
728 "--main-lcore", "1", "-c", "3"};
730 if (launch_proc(argv1) == 0
731 || launch_proc(argv2) == 0
732 || launch_proc(argv3) == 0
733 || launch_proc(argv4) == 0) {
734 printf("Error - process ran without error with wrong --main-lcore\n");
737 if (launch_proc(argv5) != 0
738 || launch_proc(argv6) != 0) {
739 printf("Error - process did not run ok with valid --main-lcore\n");
746 * Test that the app doesn't run with invalid -n flag option.
747 * Final test ensures it does run with valid options as sanity check
748 * Since -n is not compulsory for MP, we instead use --no-huge and --no-shconf
752 test_invalid_n_flag(void)
754 #ifdef RTE_EXEC_ENV_FREEBSD
755 /* BSD target doesn't support prefixes at this point */
756 const char * prefix = "";
758 char prefix[PATH_MAX], tmp[PATH_MAX];
759 if (get_current_prefix(tmp, sizeof(tmp)) == NULL) {
760 printf("Error - unable to get current prefix!\n");
763 snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp);
766 /* -n flag but no value */
767 const char *argv1[] = { prgname, prefix, no_huge, no_shconf,
769 /* bad numeric value */
770 const char *argv2[] = { prgname, prefix, no_huge, no_shconf,
772 /* zero is invalid */
773 const char *argv3[] = { prgname, prefix, no_huge, no_shconf,
775 /* sanity test - check with good value */
776 const char *argv4[] = { prgname, prefix, no_huge, no_shconf,
778 /* sanity test - check with no -n flag */
779 const char *argv5[] = { prgname, prefix, no_huge, no_shconf};
781 if (launch_proc(argv1) == 0
782 || launch_proc(argv2) == 0
783 || launch_proc(argv3) == 0) {
784 printf("Error - process ran without error when"
785 "invalid -n flag\n");
788 if (launch_proc(argv4) != 0) {
789 printf("Error - process did not run ok with valid num-channel value\n");
792 if (launch_proc(argv5) != 0) {
793 printf("Error - process did not run ok without -n flag\n");
801 * Test that the app runs with HPET, and without HPET
804 test_no_hpet_flag(void)
806 char prefix[PATH_MAX] = "";
808 #ifdef RTE_EXEC_ENV_FREEBSD
812 if (get_current_prefix(tmp, sizeof(tmp)) == NULL) {
813 printf("Error - unable to get current prefix!\n");
816 snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp);
820 const char *argv1[] = {prgname, prefix, mp_flag, no_hpet};
821 /* Without --no-hpet */
822 const char *argv2[] = {prgname, prefix, mp_flag};
824 if (launch_proc(argv1) != 0) {
825 printf("Error - process did not run ok with --no-hpet flag\n");
828 if (launch_proc(argv2) != 0) {
829 printf("Error - process did not run ok without --no-hpet flag\n");
836 * Test that the app runs with --no-huge and doesn't run when --socket-mem are
837 * specified with --no-huge.
840 test_no_huge_flag(void)
842 #ifdef RTE_EXEC_ENV_FREEBSD
843 /* BSD target doesn't support prefixes at this point, and we also need to
844 * run another primary process here */
845 const char * prefix = no_shconf;
847 const char * prefix = "--file-prefix=nohuge";
851 const char *argv1[] = {prgname, prefix, no_huge};
852 /* With --no-huge and -m */
853 const char *argv2[] = {prgname, prefix, no_huge,
854 "-m", DEFAULT_MEM_SIZE};
856 /* With --no-huge and --socket-mem */
857 const char *argv3[] = {prgname, prefix, no_huge,
858 "--socket-mem=" DEFAULT_MEM_SIZE};
859 /* With --no-huge, -m and --socket-mem */
860 const char *argv4[] = {prgname, prefix, no_huge,
861 "-m", DEFAULT_MEM_SIZE, "--socket-mem=" DEFAULT_MEM_SIZE};
862 if (launch_proc(argv1) != 0) {
863 printf("Error - process did not run ok with --no-huge flag\n");
866 if (launch_proc(argv2) != 0) {
867 printf("Error - process did not run ok with --no-huge and -m flags\n");
870 #ifdef RTE_EXEC_ENV_FREEBSD
871 /* BSD target does not support NUMA, hence no --socket-mem tests */
875 if (launch_proc(argv3) == 0) {
876 printf("Error - process run ok with --no-huge and --socket-mem "
880 if (launch_proc(argv4) == 0) {
881 printf("Error - process run ok with --no-huge, -m and "
882 "--socket-mem flags\n");
889 test_misc_flags(void)
891 char hugepath[PATH_MAX] = {0};
892 char hugepath_dir[PATH_MAX] = {0};
893 char hugepath_dir2[PATH_MAX] = {0};
894 char hugepath_dir3[PATH_MAX] = {0};
895 #ifdef RTE_EXEC_ENV_FREEBSD
896 /* BSD target doesn't support prefixes at this point */
897 const char * prefix = "";
898 const char * nosh_prefix = "";
900 char prefix[PATH_MAX], tmp[PATH_MAX];
901 const char * nosh_prefix = "--file-prefix=noshconf";
902 FILE * hugedir_handle = NULL;
903 char line[PATH_MAX] = {0};
904 unsigned i, isempty = 1;
906 if (get_current_prefix(tmp, sizeof(tmp)) == NULL) {
907 printf("Error - unable to get current prefix!\n");
910 snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp);
913 * get first valid hugepage path
916 /* get hugetlbfs mountpoints from /proc/mounts */
917 hugedir_handle = fopen("/proc/mounts", "r");
919 if (hugedir_handle == NULL) {
920 printf("Error opening /proc/mounts!\n");
924 /* read /proc/mounts */
925 while (fgets(line, sizeof(line), hugedir_handle) != NULL) {
927 /* find first valid hugepath */
928 if (get_hugepage_path(line, sizeof(line), hugepath, sizeof(hugepath)))
932 fclose(hugedir_handle);
934 /* check if path is not empty */
935 for (i = 0; i < sizeof(hugepath); i++)
936 if (hugepath[i] != '\0')
940 printf("No mounted hugepage dir found!\n");
945 snprintf(hugepath_dir, sizeof(hugepath_dir), "%s/dpdk.missing", hugepath);
946 snprintf(hugepath_dir2, sizeof(hugepath_dir2), "%s/dpdk.dir", hugepath);
948 if (mkdir(hugepath_dir2, 0700) != 0 && errno != EEXIST) {
949 printf("Error - failed to mkdir(%s)\n", hugepath_dir2);
953 snprintf(hugepath_dir3, sizeof(hugepath_dir3), "%s/dpdk.dir/sub", hugepath);
955 if (mkdir(hugepath_dir3, 0700) != 0 && errno != EEXIST) {
956 printf("Error - failed to mkdir(%s)\n", hugepath_dir3);
960 /* check that some general flags don't prevent things from working.
961 * All cases, apart from the first, app should run.
962 * No further testing of output done.
964 /* sanity check - failure with invalid option */
965 const char *argv0[] = {prgname, prefix, mp_flag, "--invalid-opt"};
968 const char *argv1[] = {prgname, prefix, mp_flag, "--no-pci"};
970 const char *argv2[] = {prgname, prefix, mp_flag, "-v"};
971 /* With valid --syslog */
972 const char *argv3[] = {prgname, prefix, mp_flag,
973 "--syslog", "syslog"};
974 /* With empty --syslog (should fail) */
975 const char *argv4[] = {prgname, prefix, mp_flag, "--syslog"};
976 /* With invalid --syslog */
977 const char *argv5[] = {prgname, prefix, mp_flag, "--syslog", "error"};
978 /* With no-sh-conf, also use no-huge to ensure this test runs on BSD */
979 const char *argv6[] = {prgname, "-m", DEFAULT_MEM_SIZE,
980 no_shconf, nosh_prefix, no_huge};
982 /* With --huge-dir */
983 const char *argv7[] = {prgname, "-m", DEFAULT_MEM_SIZE,
984 "--file-prefix=hugedir", "--huge-dir", hugepath};
985 /* With empty --huge-dir (should fail) */
986 const char *argv8[] = {prgname, "-m", DEFAULT_MEM_SIZE,
987 "--file-prefix=hugedir", "--huge-dir"};
988 /* With invalid --huge-dir */
989 const char *argv9[] = {prgname, "-m", DEFAULT_MEM_SIZE,
990 "--file-prefix=hugedir", "--huge-dir", "invalid"};
991 /* With invalid --huge-dir sub-directory */
992 const char *argv10[] = {prgname, "-m", DEFAULT_MEM_SIZE,
993 "--file-prefix=hugedir", "--huge-dir", hugepath_dir};
994 /* With valid --huge-dir sub-directory */
995 const char *argv11[] = {prgname, "-m", DEFAULT_MEM_SIZE,
996 "--file-prefix=hugedir", "--huge-dir", hugepath_dir2};
997 /* Secondary process with invalid --huge-dir (should run as flag has no
998 * effect on secondary processes) */
999 const char *argv12[] = {prgname, prefix, mp_flag,
1000 "--huge-dir", "invalid"};
1002 /* try running with base-virtaddr param */
1003 const char *argv13[] = {prgname, "--file-prefix=virtaddr",
1004 "--base-virtaddr=0x12345678"};
1006 /* try running with --vfio-intr INTx flag */
1007 const char *argv14[] = {prgname, "--file-prefix=intr",
1008 "--vfio-intr=legacy"};
1010 /* try running with --vfio-intr MSI flag */
1011 const char *argv15[] = {prgname, "--file-prefix=intr",
1014 /* try running with --vfio-intr MSI-X flag */
1015 const char *argv16[] = {prgname, "--file-prefix=intr",
1016 "--vfio-intr=msix"};
1018 /* try running with --vfio-intr invalid flag */
1019 const char *argv17[] = {prgname, "--file-prefix=intr",
1020 "--vfio-intr=invalid"};
1022 /* With process type as auto-detect */
1023 const char * const argv18[] = {prgname, "--file-prefix=auto",
1024 "--proc-type=auto"};
1026 /* With process type as auto-detect with no-shconf */
1027 const char * const argv19[] = {prgname, "--proc-type=auto",
1028 no_shconf, nosh_prefix, no_huge};
1030 /* With process type as --create-uio-dev flag */
1031 const char * const argv20[] = {prgname, "--file-prefix=uiodev",
1032 "--create-uio-dev"};
1034 /* run all tests also applicable to FreeBSD first */
1036 if (launch_proc(argv0) == 0) {
1037 printf("Error - process ran ok with invalid flag\n");
1040 if (launch_proc(argv1) != 0) {
1041 printf("Error - process did not run ok with --no-pci flag\n");
1044 if (launch_proc(argv2) != 0) {
1045 printf("Error - process did not run ok with -v flag\n");
1048 if (launch_proc(argv6) != 0) {
1049 printf("Error - process did not run ok with --no-shconf flag\n");
1053 #ifdef RTE_EXEC_ENV_FREEBSD
1054 /* no more tests to be done on FreeBSD */
1058 if (launch_proc(argv3) != 0) {
1059 printf("Error - process did not run ok with --syslog flag\n");
1062 if (launch_proc(argv4) == 0) {
1063 printf("Error - process run ok with empty --syslog flag\n");
1066 if (launch_proc(argv5) == 0) {
1067 printf("Error - process run ok with invalid --syslog flag\n");
1070 if (launch_proc(argv7) != 0) {
1071 printf("Error - process did not run ok with --huge-dir flag\n");
1074 if (launch_proc(argv8) == 0) {
1075 printf("Error - process run ok with empty --huge-dir flag\n");
1078 if (launch_proc(argv9) == 0) {
1079 printf("Error - process run ok with invalid --huge-dir flag\n");
1082 if (launch_proc(argv10) == 0) {
1083 printf("Error - process run ok with invalid --huge-dir sub-dir flag\n");
1086 if (launch_proc(argv11) != 0) {
1087 printf("Error - process did not run ok with --huge-dir subdir flag\n");
1090 if (launch_proc(argv12) != 0) {
1091 printf("Error - secondary process did not run ok with invalid --huge-dir flag\n");
1094 if (launch_proc(argv13) != 0) {
1095 printf("Error - process did not run ok with --base-virtaddr parameter\n");
1098 if (launch_proc(argv14) != 0) {
1099 printf("Error - process did not run ok with "
1100 "--vfio-intr INTx parameter\n");
1103 if (launch_proc(argv15) != 0) {
1104 printf("Error - process did not run ok with "
1105 "--vfio-intr MSI parameter\n");
1108 if (launch_proc(argv16) != 0) {
1109 printf("Error - process did not run ok with "
1110 "--vfio-intr MSI-X parameter\n");
1113 if (launch_proc(argv17) == 0) {
1114 printf("Error - process run ok with "
1115 "--vfio-intr invalid parameter\n");
1118 if (launch_proc(argv18) != 0) {
1119 printf("Error - process did not run ok with "
1120 "--proc-type as auto parameter\n");
1123 if (launch_proc(argv19) != 0) {
1124 printf("Error - process did not run ok with "
1125 "--proc-type and --no-shconf parameter\n");
1128 if (launch_proc(argv20) != 0) {
1129 printf("Error - process did not run ok with "
1130 "--create-uio-dev parameter\n");
1134 rmdir(hugepath_dir3);
1135 rmdir(hugepath_dir2);
1139 rmdir(hugepath_dir3);
1140 rmdir(hugepath_dir2);
1145 test_file_prefix(void)
1148 * 1. check if current process hugefiles are locked
1149 * 2. try to run secondary process without a corresponding primary process
1150 * (while failing to run, it will also remove any unused hugepage files)
1151 * 3. check if current process hugefiles are still in place and are locked
1152 * 4. run a primary process with memtest1 prefix in default and legacy
1154 * 5. check if memtest1 hugefiles are created in case of legacy mem
1155 * mode, and deleted in case of default mem mode
1156 * 6. run a primary process with memtest2 prefix in default and legacy
1158 * 7. check that memtest2 hugefiles are present in the hugedir after a
1159 * run in legacy mode, and not present at all after run in default
1162 char prefix[PATH_MAX] = "";
1164 #ifdef RTE_EXEC_ENV_FREEBSD
1167 if (get_current_prefix(prefix, sizeof(prefix)) == NULL) {
1168 printf("Error - unable to get current prefix!\n");
1173 /* this should fail unless the test itself is run with "memtest" prefix */
1174 const char *argv0[] = {prgname, mp_flag, "-m",
1175 DEFAULT_MEM_SIZE, "--file-prefix=" memtest };
1177 /* primary process with memtest1 and default mem mode */
1178 const char *argv1[] = {prgname, "-m",
1179 DEFAULT_MEM_SIZE, "--file-prefix=" memtest1 };
1181 /* primary process with memtest1 and legacy mem mode */
1182 const char *argv2[] = {prgname, "-m",
1183 DEFAULT_MEM_SIZE, "--file-prefix=" memtest1,
1186 /* primary process with memtest2 and legacy mem mode */
1187 const char *argv3[] = {prgname, "-m",
1188 DEFAULT_MEM_SIZE, "--file-prefix=" memtest2,
1191 /* primary process with memtest2 and default mem mode */
1192 const char *argv4[] = {prgname, "-m",
1193 DEFAULT_MEM_SIZE, "--file-prefix=" memtest2 };
1195 /* primary process with --in-memory mode */
1196 const char * const argv5[] = {prgname, "-m",
1197 DEFAULT_MEM_SIZE, "--in-memory" };
1199 /* primary process with memtest1 and --in-memory mode */
1200 const char * const argv6[] = {prgname, "-m",
1201 DEFAULT_MEM_SIZE, "--in-memory",
1202 "--file-prefix=" memtest1 };
1204 /* primary process with parent file-prefix and --in-memory mode */
1205 const char * const argv7[] = {prgname, "-m",
1206 DEFAULT_MEM_SIZE, "--in-memory", "--file-prefix", prefix };
1208 /* primary process with memtest1 and --single-file-segments mode */
1209 const char * const argv8[] = {prgname, "-m",
1210 DEFAULT_MEM_SIZE, "--single-file-segments",
1211 "--file-prefix=" memtest1 };
1213 /* primary process with memtest1 and --huge-unlink=never mode */
1214 const char * const argv9[] = {prgname, "-m",
1215 DEFAULT_MEM_SIZE, "--huge-unlink=never",
1216 "--file-prefix=" memtest1 };
1218 /* check if files for current prefix are present */
1219 if (process_hugefiles(prefix, HUGEPAGE_CHECK_EXISTS) != 1) {
1220 printf("Error - hugepage files for %s were not created!\n", prefix);
1224 /* checks if files for current prefix are locked */
1225 if (process_hugefiles(prefix, HUGEPAGE_CHECK_LOCKED) != 1) {
1226 printf("Error - hugepages for current process aren't locked!\n");
1230 /* check if files for secondary process are present */
1231 if (process_hugefiles(memtest, HUGEPAGE_CHECK_EXISTS) == 1) {
1232 /* check if they are not locked */
1233 if (process_hugefiles(memtest, HUGEPAGE_CHECK_LOCKED) == 1) {
1234 printf("Error - hugepages for current process are locked!\n");
1237 /* they aren't locked, delete them */
1239 if (process_hugefiles(memtest, HUGEPAGE_DELETE) != 1) {
1240 printf("Error - deleting hugepages failed!\n");
1246 if (launch_proc(argv0) == 0) {
1247 printf("Error - secondary process ran ok without primary process\n");
1251 /* check if files for current prefix are present */
1252 if (process_hugefiles(prefix, HUGEPAGE_CHECK_EXISTS) != 1) {
1253 printf("Error - hugepage files for %s were not created!\n", prefix);
1257 /* checks if files for current prefix are locked */
1258 if (process_hugefiles(prefix, HUGEPAGE_CHECK_LOCKED) != 1) {
1259 printf("Error - hugepages for current process aren't locked!\n");
1263 /* we're running this process in default memory mode, which means it
1264 * should clean up after itself on exit and leave no hugepages behind.
1266 if (launch_proc(argv1) != 0) {
1267 printf("Error - failed to run with --file-prefix=%s\n",
1272 /* check if memtest1_map0 is present */
1273 if (process_hugefiles(memtest1, HUGEPAGE_CHECK_EXISTS) != 0) {
1274 printf("Error - hugepage files for %s were not deleted!\n",
1279 /* now, we're running a process under the same prefix, but with legacy
1280 * mem mode - this should leave behind hugepage files.
1282 if (launch_proc(argv2) != 0) {
1283 printf("Error - failed to run with --file-prefix=%s\n",
1288 /* check if memtest1_map0 is present */
1289 if (process_hugefiles(memtest1, HUGEPAGE_CHECK_EXISTS) != 1) {
1290 printf("Error - hugepage files for %s were not created!\n",
1295 if (launch_proc(argv3) != 0) {
1296 printf("Error - failed to run with --file-prefix=%s\n",
1301 /* check if hugefiles for memtest2 are present */
1302 if (process_hugefiles(memtest2, HUGEPAGE_CHECK_EXISTS) != 1) {
1303 printf("Error - hugepage files for %s were not created!\n",
1308 /* check if hugefiles for memtest1 are present */
1309 if (process_hugefiles(memtest1, HUGEPAGE_CHECK_EXISTS) != 0) {
1310 printf("Error - hugepage files for %s were not deleted!\n",
1315 /* this process will run in default mem mode, so it should not leave any
1316 * hugepage files behind.
1318 if (launch_proc(argv4) != 0) {
1319 printf("Error - failed to run with --file-prefix=%s\n",
1324 /* check if hugefiles for memtest2 are present */
1325 if (process_hugefiles(memtest2, HUGEPAGE_CHECK_EXISTS) != 0) {
1326 printf("Error - hugepage files for %s were not deleted!\n",
1331 /* check if hugefiles for memtest1 are present */
1332 if (process_hugefiles(memtest1, HUGEPAGE_CHECK_EXISTS) != 0) {
1333 printf("Error - hugepage files for %s were not deleted!\n",
1338 /* this process will run in --in-memory mode, so it should not leave any
1339 * hugepage files behind.
1342 /* test case to check eal-options with --in-memory mode */
1343 if (launch_proc(argv5) != 0) {
1344 printf("Error - failed to run with --in-memory mode\n");
1348 /*test case to check eal-options with --in-memory mode with
1349 * custom file-prefix.
1351 if (launch_proc(argv6) != 0) {
1352 printf("Error - failed to run with --in-memory mode\n");
1356 /* check if hugefiles for memtest1 are present */
1357 if (process_hugefiles(memtest1, HUGEPAGE_CHECK_EXISTS) != 0) {
1358 printf("Error - hugepage files for %s were created and not deleted!\n",
1363 /* test case to check eal-options with --in-memory mode with
1364 * parent file-prefix.
1366 if (launch_proc(argv7) != 0) {
1367 printf("Error - failed to run with --file-prefix=%s\n", prefix);
1371 /* this process will run in --single-file-segments mode,
1372 * so it should not leave any hugepage files behind.
1374 if (launch_proc(argv8) != 0) {
1375 printf("Error - failed to run with --single-file-segments mode\n");
1379 /* check if hugefiles for memtest1 are present */
1380 if (process_hugefiles(memtest1, HUGEPAGE_CHECK_EXISTS) != 0) {
1381 printf("Error - hugepage files for %s were not deleted!\n",
1386 /* this process will run with --huge-unlink,
1387 * so it should not remove hugepage files when it exits
1389 if (launch_proc(argv9) != 0) {
1390 printf("Error - failed to run with --huge-unlink=never\n");
1394 /* check if hugefiles for memtest1 are present */
1395 if (process_hugefiles(memtest1, HUGEPAGE_CHECK_EXISTS) == 0) {
1396 printf("Error - hugepage files for %s were deleted!\n",
1400 if (process_hugefiles(memtest1, HUGEPAGE_DELETE) != 1) {
1401 printf("Error - deleting hugepages failed!\n");
1408 /* This function writes in passed buf pointer a valid --socket-mem= option
1409 * for num_sockets then concatenates the provided suffix string.
1411 * Example for num_sockets 4, mem "2", suffix "plop"
1412 * --socket-mem=2,2,2,2plop
1415 populate_socket_mem_param(int num_sockets, const char *mem,
1416 const char *suffix, char *buf, size_t buf_size)
1418 unsigned int offset = 0;
1422 written = snprintf(&buf[offset], buf_size - offset, "--socket-mem=");
1423 if (written < 0 || written + offset >= buf_size)
1427 for (i = 0; i < num_sockets - 1; i++) {
1428 written = snprintf(&buf[offset], buf_size - offset,
1430 if (written < 0 || written + offset >= buf_size)
1435 written = snprintf(&buf[offset], buf_size - offset, "%s%s", mem,
1437 if (written < 0 || written + offset >= buf_size)
1443 * Tests for correct handling of -m and --socket-mem flags
1446 test_memory_flags(void)
1448 #ifdef RTE_EXEC_ENV_FREEBSD
1449 /* BSD target doesn't support prefixes at this point */
1450 const char * prefix = "";
1452 char prefix[PATH_MAX], tmp[PATH_MAX];
1453 if (get_current_prefix(tmp, sizeof(tmp)) == NULL) {
1454 printf("Error - unable to get current prefix!\n");
1457 snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp);
1460 /* valid -m flag and mp flag */
1461 const char *argv0[] = {prgname, prefix, mp_flag,
1462 "-m", DEFAULT_MEM_SIZE};
1465 const char *argv1[] = {prgname,
1466 "--file-prefix=" memtest, "-m", DEFAULT_MEM_SIZE};
1468 /* valid (zero) --socket-mem flag */
1469 char arg2_socket_mem[SOCKET_MEM_STRLEN];
1470 const char *argv2[] = {prgname,
1471 "--file-prefix=" memtest, arg2_socket_mem};
1473 /* invalid (incomplete) --socket-mem flag */
1474 char arg3_socket_mem[SOCKET_MEM_STRLEN];
1475 const char *argv3[] = {prgname,
1476 "--file-prefix=" memtest, arg3_socket_mem};
1478 /* invalid (mixed with invalid data) --socket-mem flag */
1479 char arg4_socket_mem[SOCKET_MEM_STRLEN];
1480 const char *argv4[] = {prgname,
1481 "--file-prefix=" memtest, arg4_socket_mem};
1483 /* invalid (with numeric value as last character) --socket-mem flag */
1484 char arg5_socket_mem[SOCKET_MEM_STRLEN];
1485 const char *argv5[] = {prgname,
1486 "--file-prefix=" memtest, arg5_socket_mem};
1488 /* invalid (with empty socket) --socket-mem flag */
1489 char arg6_socket_mem[SOCKET_MEM_STRLEN];
1490 const char *argv6[] = {prgname,
1491 "--file-prefix=" memtest, arg6_socket_mem};
1493 /* invalid (null) --socket-mem flag */
1494 const char *argv7[] = {prgname,
1495 "--file-prefix=" memtest, "--socket-mem="};
1497 /* valid --socket-mem specified together with -m flag */
1498 char arg8_socket_mem[SOCKET_MEM_STRLEN];
1499 const char *argv8[] = {prgname,
1500 "--file-prefix=" memtest, "-m", DEFAULT_MEM_SIZE,
1503 #ifdef RTE_EXEC_ENV_FREEBSD
1504 int num_sockets = 1;
1506 int num_sockets = RTE_MIN(get_number_of_sockets(),
1507 RTE_MAX_NUMA_NODES);
1510 if (num_sockets <= 0) {
1511 printf("Error - cannot get number of sockets!\n");
1515 /* invalid --socket-mem flag (with extra socket) */
1516 char invalid_socket_mem[SOCKET_MEM_STRLEN];
1517 const char *argv9[] = {prgname,
1518 "--file-prefix=" memtest, invalid_socket_mem};
1520 /* valid --socket-mem flag */
1521 char valid_socket_mem[SOCKET_MEM_STRLEN];
1522 const char *argv10[] = {prgname,
1523 "--file-prefix=" memtest, valid_socket_mem};
1525 if (launch_proc(argv0) != 0) {
1526 printf("Error - secondary process failed with valid -m flag !\n");
1530 #ifdef RTE_EXEC_ENV_FREEBSD
1531 /* no other tests are applicable to BSD */
1535 if (launch_proc(argv1) != 0) {
1536 printf("Error - process failed with valid -m flag!\n");
1540 populate_socket_mem_param(num_sockets, "0", "",
1541 arg2_socket_mem, sizeof(arg2_socket_mem));
1542 if (launch_proc(argv2) != 0) {
1543 printf("Error - process failed with valid (zero) --socket-mem!\n");
1547 if (num_sockets > 1) {
1548 populate_socket_mem_param(num_sockets - 1, "2", ",",
1549 arg3_socket_mem, sizeof(arg3_socket_mem));
1550 if (launch_proc(argv3) == 0) {
1551 printf("Error - process run ok with invalid "
1552 "(incomplete) --socket-mem!\n");
1556 populate_socket_mem_param(num_sockets - 1, "2", ",Fred",
1557 arg4_socket_mem, sizeof(arg4_socket_mem));
1558 if (launch_proc(argv4) == 0) {
1559 printf("Error - process run ok with invalid "
1560 "(mixed with invalid input) --socket-mem!\n");
1564 populate_socket_mem_param(num_sockets - 1, "2", ",Fred0",
1565 arg5_socket_mem, sizeof(arg5_socket_mem));
1566 if (launch_proc(argv5) == 0) {
1567 printf("Error - process run ok with invalid "
1568 "(mixed with invalid input with a numeric value as "
1569 "last character) --socket-mem!\n");
1574 if (num_sockets > 2) {
1575 populate_socket_mem_param(num_sockets - 2, "2", ",,2",
1576 arg6_socket_mem, sizeof(arg6_socket_mem));
1577 if (launch_proc(argv6) == 0) {
1578 printf("Error - process run ok with invalid "
1579 "(with empty socket) --socket-mem!\n");
1584 if (launch_proc(argv7) == 0) {
1585 printf("Error - process run ok with invalid (null) --socket-mem!\n");
1589 populate_socket_mem_param(num_sockets, "2", "",
1590 arg8_socket_mem, sizeof(arg8_socket_mem));
1591 if (launch_proc(argv8) == 0) {
1592 printf("Error - process run ok with --socket-mem and -m specified!\n");
1596 populate_socket_mem_param(num_sockets + 1, "2", "",
1597 invalid_socket_mem, sizeof(invalid_socket_mem));
1598 if (launch_proc(argv9) == 0) {
1599 printf("Error - process run ok with extra socket in --socket-mem!\n");
1603 populate_socket_mem_param(num_sockets, "2", "",
1604 valid_socket_mem, sizeof(valid_socket_mem));
1605 if (launch_proc(argv10) != 0) {
1606 printf("Error - process failed with valid --socket-mem!\n");
1613 #endif /* !RTE_EXEC_ENV_WINDOWS */
1615 REGISTER_TEST_COMMAND(eal_flags_c_opt_autotest, test_missing_c_flag);
1616 REGISTER_TEST_COMMAND(eal_flags_main_opt_autotest, test_main_lcore_flag);
1617 REGISTER_TEST_COMMAND(eal_flags_n_opt_autotest, test_invalid_n_flag);
1618 REGISTER_TEST_COMMAND(eal_flags_hpet_autotest, test_no_hpet_flag);
1619 REGISTER_TEST_COMMAND(eal_flags_no_huge_autotest, test_no_huge_flag);
1620 REGISTER_TEST_COMMAND(eal_flags_a_opt_autotest, test_allow_flag);
1621 REGISTER_TEST_COMMAND(eal_flags_b_opt_autotest, test_invalid_b_flag);
1622 REGISTER_TEST_COMMAND(eal_flags_vdev_opt_autotest, test_invalid_vdev_flag);
1623 REGISTER_TEST_COMMAND(eal_flags_r_opt_autotest, test_invalid_r_flag);
1624 REGISTER_TEST_COMMAND(eal_flags_mem_autotest, test_memory_flags);
1625 REGISTER_TEST_COMMAND(eal_flags_file_prefix_autotest, test_file_prefix);
1626 REGISTER_TEST_COMMAND(eal_flags_misc_autotest, test_misc_flags);