Skip to content

Commit 4a8d8db

Browse files
bruce-richardsontmonjalo
authored andcommitted
app/pdump: remove hard-coded memory channels
The pdump main function modifies argc/argv before calling EAL init function. It needs to do so in order to add the proc-type=secondary flag, but also adds in "-n4" as parameter. This parameter is unnecessary and also causes duplicate parameter errors if the user also passes in -n flag on the commandline. Just remove this flag. Fixes: caa7028 ("app/pdump: add tool for packet capturing") Cc: [email protected] Signed-off-by: Bruce Richardson <[email protected]> Acked-by: Anatoly Burakov <[email protected]>
1 parent eaa1176 commit 4a8d8db

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

app/pdump/main.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -982,9 +982,8 @@ main(int argc, char **argv)
982982
int ret;
983983
int i;
984984

985-
char n_flag[] = "-n4";
986985
char mp_flag[] = "--proc-type=secondary";
987-
char *argp[argc + 2];
986+
char *argp[argc + 1];
988987

989988
/* catch ctrl-c so we can cleanup on exit */
990989
sigemptyset(&action.sa_mask);
@@ -996,13 +995,12 @@ main(int argc, char **argv)
996995
sigaction(SIGHUP, &action, NULL);
997996

998997
argp[0] = argv[0];
999-
argp[1] = n_flag;
1000-
argp[2] = mp_flag;
998+
argp[1] = mp_flag;
1001999

10021000
for (i = 1; i < argc; i++)
1003-
argp[i + 2] = argv[i];
1001+
argp[i + 1] = argv[i];
10041002

1005-
argc += 2;
1003+
argc += 1;
10061004

10071005
diag = rte_eal_init(argc, argp);
10081006
if (diag < 0)
@@ -1012,7 +1010,7 @@ main(int argc, char **argv)
10121010
rte_exit(EXIT_FAILURE, "No Ethernet ports - bye\n");
10131011

10141012
argc -= diag;
1015-
argv += (diag - 2);
1013+
argv += (diag - 1);
10161014

10171015
/* parse app arguments */
10181016
if (argc > 1) {

0 commit comments

Comments
 (0)