RE: [RFT] dumpcap: add file-prefix option

2022-10-16 Thread Kaur, Arshdeep
Hi Stephen,

These changes are looking good as compared to 
http://patches.dpdk.org/project/dpdk/patch/20220912190330.73159-1-step...@networkplumber.org/.
I have tested the changes. Works for me.
I am looking for this change in this release. Can you send the v1?

Thanks and regards,
Arshdeep Kaur

> -Original Message-
> From: Stephen Hemminger 
> Sent: Tuesday, September 13, 2022 12:34 AM
> To: dev@dpdk.org
> Cc: Stephen Hemminger ; Kaur, Arshdeep
> 
> Subject: [RFT] dumpcap: add file-prefix option
> 
> When using dumpcap in container environment or with multiple DPDK
> processes, it is useful to be able to specify file prefix.
> 
> This version only accepts the long format option used by other commands.
> If no prefix is specified then the default is used.
> 
> Suggested-by: Arshdeep Kaur 
> Signed-off-by: Stephen Hemminger 
> ---
> Did basic command line test, but still needs testing with a prefix being used
> (ie multiple apps).
> 
>  app/dumpcap/main.c | 24 ++--
>  1 file changed, 18 insertions(+), 6 deletions(-)
> 
> diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c index
> a6041d4ff495..bdeef96d9c0b 100644
> --- a/app/dumpcap/main.c
> +++ b/app/dumpcap/main.c
> @@ -61,6 +61,7 @@ static char *output_name;  static const char
> *filter_str;  static unsigned int ring_size = 2048;  static const char
> *capture_comment;
> +static const char *file_prefix;
>  static uint32_t snaplen = RTE_MBUF_DEFAULT_BUF_SIZE;  static bool
> dump_bpf;  static struct { @@ -122,6 +123,7 @@ static void usage(void)
>  "   add a capture comment to the output 
> file\n"
>  "\n"
>  "Miscellaneous:\n"
> +"  --file-prefix=   prefix to use for multi-process\n"
>  "  -q   don't report packet capture counts\n"
>  "  -v, --versionprint version information and exit\n"
>  "  -h, --help   display this help and exit\n"
> @@ -310,6 +312,7 @@ static void parse_opts(int argc, char **argv)
>   static const struct option long_options[] = {
>   { "autostop",required_argument, NULL, 'a' },
>   { "capture-comment", required_argument, NULL, 0 },
> + { "file-prefix", required_argument, NULL, 0 },
>   { "help",no_argument,   NULL, 'h' },
>   { "interface",   required_argument, NULL, 'i' },
>   { "list-interfaces", no_argument,   NULL, 'D' },
> @@ -330,11 +333,13 @@ static void parse_opts(int argc, char **argv)
> 
>   switch (c) {
>   case 0:
> - switch (option_index) {
> - case 0:
> + if (!strcmp(long_options[option_index].name,
> + "capture-comment")) {
>   capture_comment = optarg;
> - break;
> - default:
> + } else if (!strcmp(long_options[option_index].name,
> +"file-prefix")) {
> + file_prefix = optarg;
> + } else {
>   usage();
>   exit(1);
>   }
> @@ -512,12 +517,14 @@ static void dpdk_init(void)
>   static const char * const args[] = {
>   "dumpcap", "--proc-type", "secondary",
>   "--log-level", "notice"
> -
>   };
> - const int eal_argc = RTE_DIM(args);
> + int eal_argc = RTE_DIM(args);
>   char **eal_argv;
>   unsigned int i;
> 
> + if (file_prefix != NULL)
> + eal_argc += 2;
> +
>   /* DPDK API requires mutable versions of command line arguments.
> */
>   eal_argv = calloc(eal_argc + 1, sizeof(char *));
>   if (eal_argv == NULL)
> @@ -527,6 +534,11 @@ static void dpdk_init(void)
>   for (i = 1; i < RTE_DIM(args); i++)
>   eal_argv[i] = strdup(args[i]);
> 
> + if (file_prefix != NULL) {
> + eal_argv[i++] = strdup("--file-prefix");
> + eal_argv[i++] = strdup(file_prefix);
> + }
> +
>   if (rte_eal_init(eal_argc, eal_argv) < 0)
>   rte_exit(EXIT_FAILURE, "EAL init failed: is primary process
> running?\n");
> 
> --
> 2.35.1



RE: [RFT] dumpcap: add file-prefix option

2022-10-20 Thread Kaur, Arshdeep
Hi Stephen, a gentle reminder.

Thanks and regards,
Arshdeep Kaur

> -Original Message-
> From: Kaur, Arshdeep
> Sent: Monday, October 17, 2022 10:38 AM
> To: Stephen Hemminger ; dev@dpdk.org
> Cc: Chintalapalle, Balaji ; Beadle, Michael
> 
> Subject: RE: [RFT] dumpcap: add file-prefix option
> 
> Hi Stephen,
> 
> These changes are looking good as compared to
> http://patches.dpdk.org/project/dpdk/patch/20220912190330.73159-1-
> step...@networkplumber.org/.
> I have tested the changes. Works for me.
> I am looking for this change in this release. Can you send the v1?
> 
> Thanks and regards,
> Arshdeep Kaur
> 
> > -Original Message-
> > From: Stephen Hemminger 
> > Sent: Tuesday, September 13, 2022 12:34 AM
> > To: dev@dpdk.org
> > Cc: Stephen Hemminger ; Kaur,
> Arshdeep
> > 
> > Subject: [RFT] dumpcap: add file-prefix option
> >
> > When using dumpcap in container environment or with multiple DPDK
> > processes, it is useful to be able to specify file prefix.
> >
> > This version only accepts the long format option used by other
> commands.
> > If no prefix is specified then the default is used.
> >
> > Suggested-by: Arshdeep Kaur 
> > Signed-off-by: Stephen Hemminger 
> > ---
> > Did basic command line test, but still needs testing with a prefix
> > being used (ie multiple apps).
> >
> >  app/dumpcap/main.c | 24 ++--
> >  1 file changed, 18 insertions(+), 6 deletions(-)
> >
> > diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c index
> > a6041d4ff495..bdeef96d9c0b 100644
> > --- a/app/dumpcap/main.c
> > +++ b/app/dumpcap/main.c
> > @@ -61,6 +61,7 @@ static char *output_name;  static const char
> > *filter_str;  static unsigned int ring_size = 2048;  static const char
> > *capture_comment;
> > +static const char *file_prefix;
> >  static uint32_t snaplen = RTE_MBUF_DEFAULT_BUF_SIZE;  static bool
> > dump_bpf;  static struct { @@ -122,6 +123,7 @@ static void usage(void)
> >"   add a capture comment to the output 
> > file\n"
> >"\n"
> >"Miscellaneous:\n"
> > +  "  --file-prefix=   prefix to use for multi-process\n"
> >"  -q   don't report packet capture counts\n"
> >"  -v, --versionprint version information and exit\n"
> >"  -h, --help   display this help and exit\n"
> > @@ -310,6 +312,7 @@ static void parse_opts(int argc, char **argv)
> > static const struct option long_options[] = {
> > { "autostop",required_argument, NULL, 'a' },
> > { "capture-comment", required_argument, NULL, 0 },
> > +   { "file-prefix", required_argument, NULL, 0 },
> > { "help",no_argument,   NULL, 'h' },
> > { "interface",   required_argument, NULL, 'i' },
> > { "list-interfaces", no_argument,   NULL, 'D' },
> > @@ -330,11 +333,13 @@ static void parse_opts(int argc, char **argv)
> >
> > switch (c) {
> > case 0:
> > -   switch (option_index) {
> > -   case 0:
> > +   if (!strcmp(long_options[option_index].name,
> > +   "capture-comment")) {
> > capture_comment = optarg;
> > -   break;
> > -   default:
> > +   } else if (!strcmp(long_options[option_index].name,
> > +  "file-prefix")) {
> > +   file_prefix = optarg;
> > +   } else {
> > usage();
> > exit(1);
> > }
> > @@ -512,12 +517,14 @@ static void dpdk_init(void)
> > static const char * const args[] = {
> > "dumpcap", "--proc-type", "secondary",
> > "--log-level", "notice"
> > -
> > };
> > -   const int eal_argc = RTE_DIM(args);
> > +   int eal_argc = RTE_DIM(args);
> > char **eal_argv;
> > unsigned int i;
> >
> > +   if (file_prefix != NULL)
> > +   eal_argc += 2;
> > +
> > /* DPDK API requires mutable versions of command line arguments.
> > */
> > eal_argv = calloc(eal_argc + 1, sizeof(char *));
> > if (eal_argv == NULL)
> > @@ -527,6 +534,11 @@ static void dpdk_init(void)
> > for (i = 1; i < RTE_DIM(args); i++)
> > eal_argv[i] = strdup(args[i]);
> >
> > +   if (file_prefix != NULL) {
> > +   eal_argv[i++] = strdup("--file-prefix");
> > +   eal_argv[i++] = strdup(file_prefix);
> > +   }
> > +
> > if (rte_eal_init(eal_argc, eal_argv) < 0)
> > rte_exit(EXIT_FAILURE, "EAL init failed: is primary process
> > running?\n");
> >
> > --
> > 2.35.1



RE: [RFT] dumpcap: add file-prefix option

2022-10-20 Thread Kaur, Arshdeep
> -Original Message-
> From: Stephen Hemminger 
> Sent: Tuesday, September 13, 2022 12:34 AM
> To: dev@dpdk.org
> Cc: Stephen Hemminger ; Kaur, Arshdeep
> 
> Subject: [RFT] dumpcap: add file-prefix option
> 
> When using dumpcap in container environment or with multiple DPDK
> processes, it is useful to be able to specify file prefix.
> 
> This version only accepts the long format option used by other commands.
> If no prefix is specified then the default is used.
> 
> Suggested-by: Arshdeep Kaur 
> Signed-off-by: Stephen Hemminger 

Looks good ready to merge.

Acked-by:  Arshdeep Kaur 

Tested-by: Arshdeep Kaur 



RE: [PATCH v2] dumpcap: add the mutiprocess fileprefix support.

2022-09-12 Thread Kaur, Arshdeep



> -Original Message-
> From: Kaur, Arshdeep 
> Sent: Wednesday, September 7, 2022 9:57 PM
> To: dev@dpdk.org
> Cc: Kaur, Arshdeep 
> Subject: [PATCH v2] dumpcap: add the mutiprocess fileprefix support.

Gentle reminder for review.



RE: [RFT] dumpcap: add file-prefix option

2022-09-16 Thread Kaur, Arshdeep



> -Original Message-
> From: Stephen Hemminger 
> Sent: Tuesday, September 13, 2022 12:34 AM
> To: dev@dpdk.org
> Cc: Stephen Hemminger ; Kaur, Arshdeep
> 
> Subject: [RFT] dumpcap: add file-prefix option
> 
> When using dumpcap in container environment or with multiple DPDK
> processes, it is useful to be able to specify file prefix.
> 
> This version only accepts the long format option used by other commands.
> If no prefix is specified then the default is used.
> 
> Suggested-by: Arshdeep Kaur 
> Signed-off-by: Stephen Hemminger 
> ---
> Did basic command line test, but still needs testing with a prefix being used
> (ie multiple apps).
> 
>  app/dumpcap/main.c | 24 ++--
>  1 file changed, 18 insertions(+), 6 deletions(-)
> 
> diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c index
> a6041d4ff495..bdeef96d9c0b 100644
> --- a/app/dumpcap/main.c
> +++ b/app/dumpcap/main.c
> @@ -61,6 +61,7 @@ static char *output_name;  static const char
> *filter_str;  static unsigned int ring_size = 2048;  static const char
> *capture_comment;
> +static const char *file_prefix;
>  static uint32_t snaplen = RTE_MBUF_DEFAULT_BUF_SIZE;  static bool
> dump_bpf;  static struct { @@ -122,6 +123,7 @@ static void usage(void)
>  "   add a capture comment to the output 
> file\n"
>  "\n"
>  "Miscellaneous:\n"
> +"  --file-prefix=   prefix to use for multi-process\n"
>  "  -q   don't report packet capture counts\n"
>  "  -v, --versionprint version information and exit\n"
>  "  -h, --help   display this help and exit\n"
> @@ -310,6 +312,7 @@ static void parse_opts(int argc, char **argv)
>   static const struct option long_options[] = {
>   { "autostop",required_argument, NULL, 'a' },
>   { "capture-comment", required_argument, NULL, 0 },
> + { "file-prefix", required_argument, NULL, 0 },
>   { "help",no_argument,   NULL, 'h' },
>   { "interface",   required_argument, NULL, 'i' },
>   { "list-interfaces", no_argument,   NULL, 'D' },
> @@ -330,11 +333,13 @@ static void parse_opts(int argc, char **argv)
> 
>   switch (c) {
>   case 0:
> - switch (option_index) {
> - case 0:
> + if (!strcmp(long_options[option_index].name,
> + "capture-comment")) {
>   capture_comment = optarg;
> - break;
> - default:
> + } else if (!strcmp(long_options[option_index].name,
> +"file-prefix")) {
> + file_prefix = optarg;
> + } else {
>   usage();
>   exit(1);
>   }

parse_opts() is called after dpdk_init(). So whatever file-prefix we provide, 
for eal init, it remains NULL.
Please let me know your thoughts about it.

> @@ -512,12 +517,14 @@ static void dpdk_init(void)
>   static const char * const args[] = {
>   "dumpcap", "--proc-type", "secondary",
>   "--log-level", "notice"
> -
>   };
> - const int eal_argc = RTE_DIM(args);
> + int eal_argc = RTE_DIM(args);
>   char **eal_argv;
>   unsigned int i;
> 
> + if (file_prefix != NULL)
> + eal_argc += 2;
> +
>   /* DPDK API requires mutable versions of command line arguments.
> */
>   eal_argv = calloc(eal_argc + 1, sizeof(char *));
>   if (eal_argv == NULL)
> @@ -527,6 +534,11 @@ static void dpdk_init(void)
>   for (i = 1; i < RTE_DIM(args); i++)
>   eal_argv[i] = strdup(args[i]);
> 
> + if (file_prefix != NULL) {
> + eal_argv[i++] = strdup("--file-prefix");
> + eal_argv[i++] = strdup(file_prefix);
> + }
> +
>   if (rte_eal_init(eal_argc, eal_argv) < 0)
>   rte_exit(EXIT_FAILURE, "EAL init failed: is primary process
> running?\n");
> 
> --
> 2.35.1



RE: [RFT] dumpcap: add file-prefix option

2022-09-19 Thread Kaur, Arshdeep



> -Original Message-
> From: Stephen Hemminger 
> Sent: Friday, September 16, 2022 9:05 PM
> To: Ben Magistro 
> Cc: Kaur, Arshdeep ; dev@dpdk.org
> Subject: Re: [RFT] dumpcap: add file-prefix option
> 
> On Fri, 16 Sep 2022 08:51:59 -0400
> Ben Magistro  wrote:
> 
> > Kaur,
> >
> > I believe parse_opts() should be called before dpdk_init() now see
> > https://patches.dpdk.org/project/dpdk/patch/20220125032545.7704-1-
> konc
> > e...@gmail.com/
> 
> Correct, in main branch parse_opts is before dpdk_init

Hi Stephen and Ben. I have a doubt regarding this. According to me if dpdk_init 
is called after parse_opts, then some caller functions (called from within 
parse_opts) are affected.
Eg. 1) Parameter 'D' : { "list-interfaces", no_argument,   NULL, 'D' }, 
does not give any output.
2) Parameter 'i' : { "interface",   required_argument, NULL, 'i' }, 
does not behave properly. 
I think the reason is that port list is available after eal init. 
Dumpcap(secondary process) will inherit the ports used by primary process.
This implies that dpdk_init should be called before parse_opts.
But then for multiprocess support, primary process is to be picked up by 
providing a file-prefix (Added in parse_opts).
This implies that parse_opts should be called before dpdk_init.

So according to me there was a deadlock situation here. Which I handled by 
providing file-prefix input to the program before dpdk_init manually. And then 
after dpdk_init, parse_opts should be called.

Please let me know if I am going in the wrong direction. And how else can we 
solve this?

NOTE: There is a bug in 'if' condition of select_interface function. Control 
should enter the 'if' condition if we provide select interface as '*' but 
instead it enters when they are unequal. So I have already submitted a patch 
for that. And it is acknowledged. Change done is:
- if (strcmp(arg, "*"))
+ if (!strcmp(arg, "*"))



RE: [RFT] dumpcap: add file-prefix option

2022-09-23 Thread Kaur, Arshdeep
++ Balaji and Mike.

> -Original Message-
> From: Kaur, Arshdeep 
> Sent: Friday, September 16, 2022 1:49 PM
> To: Stephen Hemminger ; dev@dpdk.org
> Subject: RE: [RFT] dumpcap: add file-prefix option
> 
> 
> 
> > -Original Message-
> > From: Stephen Hemminger 
> > Sent: Tuesday, September 13, 2022 12:34 AM
> > To: dev@dpdk.org
> > Cc: Stephen Hemminger ; Kaur,
> Arshdeep
> > 
> > Subject: [RFT] dumpcap: add file-prefix option
> >
> > When using dumpcap in container environment or with multiple DPDK
> > processes, it is useful to be able to specify file prefix.
> >
> > This version only accepts the long format option used by other
> commands.
> > If no prefix is specified then the default is used.
> >
> > Suggested-by: Arshdeep Kaur 
> > Signed-off-by: Stephen Hemminger 
> > ---
> > Did basic command line test, but still needs testing with a prefix
> > being used (ie multiple apps).
> >
> >  app/dumpcap/main.c | 24 ++--
> >  1 file changed, 18 insertions(+), 6 deletions(-)
> >
> > diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c index
> > a6041d4ff495..bdeef96d9c0b 100644
> > --- a/app/dumpcap/main.c
> > +++ b/app/dumpcap/main.c
> > @@ -61,6 +61,7 @@ static char *output_name;  static const char
> > *filter_str;  static unsigned int ring_size = 2048;  static const char
> > *capture_comment;
> > +static const char *file_prefix;
> >  static uint32_t snaplen = RTE_MBUF_DEFAULT_BUF_SIZE;  static bool
> > dump_bpf;  static struct { @@ -122,6 +123,7 @@ static void usage(void)
> >"   add a capture comment to the output 
> > file\n"
> >"\n"
> >"Miscellaneous:\n"
> > +  "  --file-prefix=   prefix to use for multi-process\n"
> >"  -q   don't report packet capture counts\n"
> >"  -v, --versionprint version information and exit\n"
> >"  -h, --help   display this help and exit\n"
> > @@ -310,6 +312,7 @@ static void parse_opts(int argc, char **argv)
> > static const struct option long_options[] = {
> > { "autostop",required_argument, NULL, 'a' },
> > { "capture-comment", required_argument, NULL, 0 },
> > +   { "file-prefix", required_argument, NULL, 0 },
> > { "help",no_argument,   NULL, 'h' },
> > { "interface",   required_argument, NULL, 'i' },
> > { "list-interfaces", no_argument,   NULL, 'D' },
> > @@ -330,11 +333,13 @@ static void parse_opts(int argc, char **argv)
> >
> > switch (c) {
> > case 0:
> > -   switch (option_index) {
> > -   case 0:
> > +   if (!strcmp(long_options[option_index].name,
> > +   "capture-comment")) {
> > capture_comment = optarg;
> > -   break;
> > -   default:
> > +   } else if (!strcmp(long_options[option_index].name,
> > +  "file-prefix")) {
> > +   file_prefix = optarg;
> > +   } else {
> > usage();
> > exit(1);
> > }
> 
> parse_opts() is called after dpdk_init(). So whatever file-prefix we provide,
> for eal init, it remains NULL.
> Please let me know your thoughts about it.
> 
> > @@ -512,12 +517,14 @@ static void dpdk_init(void)
> > static const char * const args[] = {
> > "dumpcap", "--proc-type", "secondary",
> > "--log-level", "notice"
> > -
> > };
> > -   const int eal_argc = RTE_DIM(args);
> > +   int eal_argc = RTE_DIM(args);
> > char **eal_argv;
> > unsigned int i;
> >
> > +   if (file_prefix != NULL)
> > +   eal_argc += 2;
> > +
> > /* DPDK API requires mutable versions of command line arguments.
> > */
> > eal_argv = calloc(eal_argc + 1, sizeof(char *));
> > if (eal_argv == NULL)
> > @@ -527,6 +534,11 @@ static void dpdk_init(void)
> > for (i = 1; i < RTE_DIM(args); i++)
> > eal_argv[i] = strdup(args[i]);
> >
> > +   if (file_prefix != NULL) {
> > +   eal_argv[i++] = strdup("--file-prefix");
> > +   eal_argv[i++] = strdup(file_prefix);
> > +   }
> > +
> > if (rte_eal_init(eal_argc, eal_argv) < 0)
> > rte_exit(EXIT_FAILURE, "EAL init failed: is primary process
> > running?\n");
> >
> > --
> > 2.35.1



RE: [PATCH] dumpcap: fix list interfaces

2022-10-04 Thread Kaur, Arshdeep
Hi Stephen,

I tested the patch. "-D" option is now working properly.

But I am facing an issue in this.

Using "-D" provides me with the interfaces available. For me these are 
":18:01.0" and ":18:09.0":
./dpdk-dumpcap -D --file-prefix wls_1
FlexRAN SDK bblib_lte_ldpc_decoder version #DIRTY#
FlexRAN SDK bblib_lte_ldpc_encoder version #DIRTY#
FlexRAN SDK bblib_lte_LDPC_ratematch version #DIRTY#
FlexRAN SDK bblib_lte_rate_dematching_5gnr version #DIRTY#
FlexRAN SDK bblib_lte_turbo version #DIRTY#
FlexRAN SDK bblib_lte_crc version #DIRTY#
FlexRAN SDK bblib_lte_rate_matching version #DIRTY#
FlexRAN SDK bblib_common version #DIRTY#
FlexRAN SDK bblib_srs_fft_cestimate_5gnr version #DIRTY#
FlexRAN SDK bblib_mldts_process_5gnr version #DIRTY#
EAL: :18:01.1 cannot find TAILQ entry for PCI device!
EAL: Requested device :18:01.1 cannot be used
EAL: :18:09.1 cannot find TAILQ entry for PCI device!
EAL: Requested device :18:09.1 cannot be used
EAL: :18:11.0 cannot find TAILQ entry for PCI device!
EAL: Requested device :18:11.0 cannot be used
EAL: :18:11.1 cannot find TAILQ entry for PCI device!
EAL: Requested device :18:11.1 cannot be used
EAL: :18:19.0 cannot find TAILQ entry for PCI device!
EAL: Requested device :18:19.0 cannot be used
EAL: :18:19.1 cannot find TAILQ entry for PCI device!
EAL: Requested device :18:19.1 cannot be used
EAL: :af:01.0 cannot find TAILQ entry for PCI device!
EAL: Requested device :af:01.0 cannot be used
EAL: :af:01.1 cannot find TAILQ entry for PCI device!
EAL: Requested device :af:01.1 cannot be used
EAL: :af:09.0 cannot find TAILQ entry for PCI device!
EAL: Requested device :af:09.0 cannot be used
EAL: :af:09.1 cannot find TAILQ entry for PCI device!
EAL: Requested device :af:09.1 cannot be used
EAL: :af:11.0 cannot find TAILQ entry for PCI device!
EAL: Requested device :af:11.0 cannot be used
EAL: :af:11.1 cannot find TAILQ entry for PCI device!
EAL: Requested device :af:11.1 cannot be used
EAL: :af:19.0 cannot find TAILQ entry for PCI device!
EAL: Requested device :af:19.0 cannot be used
EAL: :af:19.1 cannot find TAILQ entry for PCI device!
EAL: Requested device :af:19.1 cannot be used
0. :18:01.0
1. :18:09.0

But when I use these same interfaces to capture, they are not available:
./dpdk-dumpcap -i :18:01.0 -c 500 -s 9600 -w capture1.pacp --file-prefix 
wls_1
FlexRAN SDK bblib_lte_ldpc_decoder version #DIRTY#
FlexRAN SDK bblib_lte_ldpc_encoder version #DIRTY#
FlexRAN SDK bblib_lte_LDPC_ratematch version #DIRTY#
FlexRAN SDK bblib_lte_rate_dematching_5gnr version #DIRTY#
FlexRAN SDK bblib_lte_turbo version #DIRTY#
FlexRAN SDK bblib_lte_crc version #DIRTY#
FlexRAN SDK bblib_lte_rate_matching version #DIRTY#
FlexRAN SDK bblib_common version #DIRTY#
FlexRAN SDK bblib_srs_fft_cestimate_5gnr version #DIRTY#
FlexRAN SDK bblib_mldts_process_5gnr version #DIRTY#
EAL: Error - exiting with code: 1
  Cause: Specified port_number ":18:01.0" is not a valid number

./dpdk-dumpcap -i :18:09.0 -c 500 -s 9600 -w capture2.pacp --file-prefix 
wls_1
FlexRAN SDK bblib_lte_ldpc_decoder version #DIRTY#
FlexRAN SDK bblib_lte_ldpc_encoder version #DIRTY#
FlexRAN SDK bblib_lte_LDPC_ratematch version #DIRTY#
FlexRAN SDK bblib_lte_rate_dematching_5gnr version #DIRTY#
FlexRAN SDK bblib_lte_turbo version #DIRTY#
FlexRAN SDK bblib_lte_crc version #DIRTY#
FlexRAN SDK bblib_lte_rate_matching version #DIRTY#
FlexRAN SDK bblib_common version #DIRTY#
FlexRAN SDK bblib_srs_fft_cestimate_5gnr version #DIRTY#
FlexRAN SDK bblib_mldts_process_5gnr version #DIRTY#
EAL: Error - exiting with code: 1
  Cause: Specified port_number ":18:09.0" is not a valid number

According to me, select_interface() has same issue that dump_interfaces() had. 
So we need to add a flag for this in similar way and handle select_interface() 
in main after parse_opts, dpdk_init and dump_interfaces.

I tested this changes and it works for me. But I am not sure how it will affect 
entire dumpcap. Please let me know your thoughts about it.

Thanks and regards,
Arshdeep Kaur

> -Original Message-
> From: Stephen Hemminger 
> Sent: Monday, September 26, 2022 5:04 AM
> To: dev@dpdk.org
> Cc: Stephen Hemminger ;
> konce...@gmail.com; Pattan, Reshma 
> Subject: [PATCH] dumpcap: fix list interfaces
> 
> The change to do argument process before EAL init broke the support of
> list-interfaces option. Fix by setting flag and doing list-interfaces later.
> 
> Fixes: a8dde09f97df ("app/dumpcap: allow help/version without primary
> process")
> Cc: konce...@gmail.com
> Signed-off-by: Stephen Hemminger 
> ---
>  app/dumpcap/main.c | 19 +--
>  1 file changed, 13 insertions(+), 6 deletions(-)
> 
> diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c index
> a6041d4ff495..490a0f050bc8 100644
> --- a/app/dumpcap/main.c
> +++ b/app/dumpcap/main.c
> @@ -63,6 +63,8 @@ static unsigned int ring_size = 2048;  st