[RFT] dumpcap: add file-prefix option

Kaur, Arshdeep arshdeep.kaur at intel.com
Mon Sep 19 13:19:59 CEST 2022



> -----Original Message-----
> From: Stephen Hemminger <stephen at networkplumber.org>
> Sent: Friday, September 16, 2022 9:05 PM
> To: Ben Magistro <koncept1 at gmail.com>
> Cc: Kaur, Arshdeep <arshdeep.kaur at intel.com>; dev at dpdk.org
> Subject: Re: [RFT] dumpcap: add file-prefix option
> 
> On Fri, 16 Sep 2022 08:51:59 -0400
> Ben Magistro <koncept1 at gmail.com> 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
> > ept1 at 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, "*"))



More information about the dev mailing list