From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 1DA0B2C09 for ; Tue, 24 May 2016 19:20:28 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP; 24 May 2016 10:20:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,360,1459839600"; d="scan'208";a="109696211" Received: from irsmsx109.ger.corp.intel.com ([163.33.3.23]) by fmsmga004.fm.intel.com with ESMTP; 24 May 2016 10:20:20 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.33]) by IRSMSX109.ger.corp.intel.com ([169.254.13.38]) with mapi id 14.03.0248.002; Tue, 24 May 2016 18:20:19 +0100 From: "Dumitrescu, Cristian" To: "Singh, Jasvinder" , "dev@dpdk.org" CC: "Chokkalingam, SankarX" Thread-Topic: [PATCH] ip_pipeline: add command for multiple execution of run Thread-Index: AQHRp8nlco9AwyZ8bkSYlD3SOFTSlp/IcO9w Date: Tue, 24 May 2016 17:20:19 +0000 Message-ID: <3EB4FA525960D640B5BDFFD6A3D89126479EC68A@IRSMSX108.ger.corp.intel.com> References: <1462561743-76966-1-git-send-email-jasvinder.singh@intel.com> In-Reply-To: <1462561743-76966-1-git-send-email-jasvinder.singh@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMzYwMTQ5MjctOTY0NC00NGY1LTkxYTItYmI4ZTVhOTI5ZWRhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IkY2YXl6OGs1SW42M0I5enBLZXF6NjFuMUd3c001U3hXT1hcL3Q2R3htMmVjPSJ9 x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] ip_pipeline: add command for multiple execution of run X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2016 17:20:29 -0000 > -----Original Message----- > From: Singh, Jasvinder > Sent: Friday, May 6, 2016 8:09 PM > To: dev@dpdk.org > Cc: Dumitrescu, Cristian ; Chokkalingam, > SankarX > Subject: [PATCH] ip_pipeline: add command for multiple execution of run > >=20 > From: Sankar Chokkalingam >=20 > The new command enables the execution of script-file for 'n' number of > times in regular intervals. It takes script-file, number of times to be > executed, interval between each execution as inputs. >=20 > Syntax: run >=20 > Usage: This command helps to collect statistics of ports and pipelines in > periodic interval. >=20 > Example: run port_stats 5 30 >=20 > The port_stats file may contain the list of port stats commands like > p 1 port in 0 stats > p 1 port out 0 stats > p 2 port in 0 stats > p 2 port out 0 stats > p 2 port in 1 stats > p 2 port out stats. >=20 > The list of commands in the file will be executed 5 times with the > interval of 30 seconds. >=20 > Signed-off-by: Sankar Chokkalingam > --- > examples/ip_pipeline/pipeline/pipeline_common_fe.c | 50 > ++++++++++++++++++++++ > 1 file changed, 50 insertions(+) >=20 > diff --git a/examples/ip_pipeline/pipeline/pipeline_common_fe.c > b/examples/ip_pipeline/pipeline/pipeline_common_fe.c > index a691d42..9f7ef08 100644 > --- a/examples/ip_pipeline/pipeline/pipeline_common_fe.c > +++ b/examples/ip_pipeline/pipeline/pipeline_common_fe.c > @@ -1267,9 +1267,59 @@ cmdline_parse_inst_t cmd_run =3D { > }, > }; >=20 > +struct cmd_multirun_file_result { > + cmdline_fixed_string_t run_string; > + char file_name[APP_FILE_NAME_SIZE]; > + uint32_t count; > + uint32_t interval; > +}; > + > +static void > +cmd_multirun_parsed( > + void *parsed_result, > + struct cmdline *cl, > + __attribute__((unused)) void *data) > +{ > + struct cmd_multirun_file_result *params =3D parsed_result; > + uint32_t i; > + > + for (i =3D 0; i < params->count; i++) { > + app_run_file(cl->ctx, params->file_name); > + sleep(params->interval); > + } > +} > + > +cmdline_parse_token_string_t cmd_multirun_run_string =3D > + TOKEN_STRING_INITIALIZER(struct cmd_multirun_file_result, > run_string, > + "run"); > + > +cmdline_parse_token_string_t cmd_multirun_file_name =3D > + TOKEN_STRING_INITIALIZER(struct cmd_multirun_file_result, > file_name, NULL); > + > +static cmdline_parse_token_num_t cmd_multirun_count =3D > + TOKEN_NUM_INITIALIZER(struct cmd_multirun_file_result, count, > UINT32); > + > +static cmdline_parse_token_num_t cmd_multirun_interval =3D > + TOKEN_NUM_INITIALIZER(struct cmd_multirun_file_result, interval, > UINT32); > + > +cmdline_parse_inst_t cmd_multirun =3D { > + .f =3D cmd_multirun_parsed, > + .data =3D NULL, > + .help_str =3D "Run CLI script file", > + .tokens =3D { > + (void *) &cmd_multirun_run_string, > + (void *) &cmd_multirun_file_name, > + (void *) &cmd_multirun_count, > + (void *) &cmd_multirun_interval, > + NULL, > + }, > +}; > + > + > static cmdline_parse_ctx_t pipeline_common_cmds[] =3D { > (cmdline_parse_inst_t *) &cmd_quit, > (cmdline_parse_inst_t *) &cmd_run, > + (cmdline_parse_inst_t *) &cmd_multirun, >=20 > (cmdline_parse_inst_t *) &cmd_link_config, > (cmdline_parse_inst_t *) &cmd_link_up, > -- > 1.8.3.1 Hi Jasvinder and Sankar, This patch is now reworked and included into the ip_pipeline CLI rework pa= tch set that Michal and Piotr sent: http://www.dpdk.org/ml/archives/dev/201= 6-May/039429.html So we can safely discard this patch now. Thanks, Cristian