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 F12A72BB9 for ; Thu, 15 Jun 2017 14:05:16 +0200 (CEST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Jun 2017 05:05:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,343,1493708400"; d="scan'208";a="115263570" Received: from irsmsx105.ger.corp.intel.com ([163.33.3.28]) by fmsmga006.fm.intel.com with ESMTP; 15 Jun 2017 05:05:15 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.133]) by irsmsx105.ger.corp.intel.com ([169.254.7.168]) with mapi id 14.03.0319.002; Thu, 15 Jun 2017 13:05:14 +0100 From: "De Lara Guarch, Pablo" To: "Wu, Jingjing" CC: "dev@dpdk.org" Thread-Topic: [PATCH v3] app/testpmd: add parameter to start forwarding TX first Thread-Index: AQHS5c96uLZACKAl/0e4LbZpoCRzpKIl03cA Date: Thu, 15 Jun 2017 12:05:13 +0000 Message-ID: References: <20170609023044.75127-1-pablo.de.lara.guarch@intel.com> <20170615040403.78712-1-pablo.de.lara.guarch@intel.com> In-Reply-To: <20170615040403.78712-1-pablo.de.lara.guarch@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMTE3MjUzNmYtNDNhOS00ZWMwLTgwOWMtODBiNWI1MzNhMDAwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IlV2Tkc5WUY3NytpdFphN1JMaGhnM2xqZVF4QUxcL3BldVwvUER5UzA5aU5FOD0ifQ== x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v3] app/testpmd: add parameter to start forwarding TX first X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jun 2017 12:05:17 -0000 Sending to right Jingjing mail address. > -----Original Message----- > From: De Lara Guarch, Pablo > Sent: Thursday, June 15, 2017 5:04 AM > To: jingjing.wu@dpdk.org > Cc: dev@dpdk.org; De Lara Guarch, Pablo > Subject: [PATCH v3] app/testpmd: add parameter to start forwarding TX > first >=20 > Add parameter to start forwarding sending first > a burst of packets, which is useful when testing > a loopback connection. >=20 > This was already implemented as an internal command, > but adding it as a parameter is interesting, as it > allows the user to test a loopback connection without > entering in the internal command line. >=20 > Signed-off-by: Pablo de Lara > --- >=20 > Changes in v3: >=20 > -Added tx-first in long parameter list > -Reworded informational message when tx-first is enabled >=20 > Changes in v2: >=20 > - Added check to prevent user from using --tx-first in interactive mode, > to avoid confusion > - Added extra information in testpmd help about the new parameter >=20 > app/test-pmd/parameters.c | 9 +++++++++ > app/test-pmd/testpmd.c | 6 +++++- > app/test-pmd/testpmd.h | 1 + > doc/guides/testpmd_app_ug/run_app.rst | 8 ++++++++ > 4 files changed, 23 insertions(+), 1 deletion(-) >=20 > diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c > index fbe6284..0a88844 100644 > --- a/app/test-pmd/parameters.c > +++ b/app/test-pmd/parameters.c > @@ -89,6 +89,7 @@ usage(char* progname) > "[--cmdline-file=3DFILENAME] " > #endif > "[--help|-h] | [--auto-start|-a] | [" > + "--tx-first | " > "--coremask=3DCOREMASK --portmask=3DPORTMASK --numa " > "--mbuf-size=3D | --total-num-mbufs=3D | " > "--nb-cores=3D | --nb-ports=3D | " > @@ -109,6 +110,8 @@ usage(char* progname) > printf(" --auto-start: start forwarding on init " > "[always when non-interactive].\n"); > printf(" --help: display this message and quit.\n"); > + printf(" --tx-first: start forwarding sending a burst first " > + "(only if interactive is disabled).\n"); > printf(" --nb-cores=3DN: set the number of forwarding cores " > "(1 <=3D N <=3D %d).\n", nb_lcores); > printf(" --nb-ports=3DN: set the number of forwarding ports " > @@ -566,6 +569,7 @@ launch_args_parse(int argc, char** argv) > { "eth-peers-configfile", 1, 0, 0 }, > { "eth-peer", 1, 0, 0 }, > #endif > + { "tx-first", 0, 0, 0 }, > { "ports", 1, 0, 0 }, > { "nb-cores", 1, 0, 0 }, > { "nb-ports", 1, 0, 0 }, > @@ -674,6 +678,11 @@ launch_args_parse(int argc, char** argv) > printf("Auto-start selected\n"); > auto_start =3D 1; > } > + if (!strcmp(lgopts[opt_idx].name, "tx-first")) { > + printf("Ports to start sending a burst of " > + "packets first\n"); > + tx_first =3D 1; > + } > if (!strcmp(lgopts[opt_idx].name, > "eth-peers-configfile")) { > if (init_peer_eth_addrs(optarg) !=3D 0) > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c > index d32cbb9..6001283 100644 > --- a/app/test-pmd/testpmd.c > +++ b/app/test-pmd/testpmd.c > @@ -98,6 +98,7 @@ uint16_t verbose_level =3D 0; /**< Silent by default. *= / > /* use master core for command line ? */ > uint8_t interactive =3D 0; > uint8_t auto_start =3D 0; > +uint8_t tx_first; > char cmdline_filename[PATH_MAX] =3D {0}; >=20 > /* > @@ -2294,6 +2295,9 @@ main(int argc, char** argv) > if (argc > 1) > launch_args_parse(argc, argv); >=20 > + if (tx_first && interactive) > + rte_exit(EXIT_FAILURE, "--tx-first cannot be used on " > + "interactive mode.\n"); > if (!nb_rxq && !nb_txq) > printf("Warning: Either rx or tx queues should be non- > zero\n"); >=20 > @@ -2353,7 +2357,7 @@ main(int argc, char** argv) > int rc; >=20 > printf("No commandline core given, start packet > forwarding\n"); > - start_packet_forwarding(0); > + start_packet_forwarding(tx_first); > printf("Press enter to exit\n"); > rc =3D read(0, &c, 1); > pmd_test_exit(); > diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h > index 364502d..5cabeef 100644 > --- a/app/test-pmd/testpmd.h > +++ b/app/test-pmd/testpmd.h > @@ -299,6 +299,7 @@ extern uint16_t nb_rx_queue_stats_mappings; > extern uint16_t verbose_level; /**< Drives messages being displayed, if > any. */ > extern uint8_t interactive; > extern uint8_t auto_start; > +extern uint8_t tx_first; > extern char cmdline_filename[PATH_MAX]; /**< offline commands file */ > extern uint8_t numa_support; /**< set by "--numa" parameter */ > extern uint16_t port_topology; /**< set by "--port-topology" parameter *= / > diff --git a/doc/guides/testpmd_app_ug/run_app.rst > b/doc/guides/testpmd_app_ug/run_app.rst > index 2a43214..3159398 100644 > --- a/doc/guides/testpmd_app_ug/run_app.rst > +++ b/doc/guides/testpmd_app_ug/run_app.rst > @@ -188,6 +188,14 @@ The commandline options are: >=20 > Start forwarding on initialization. >=20 > +* ``--tx-first`` > + > + Start forwarding, after sending a burst of packets first. > + > +.. Note:: > + > + This flag should be only used in non-interactive mode. > + > * ``--nb-cores=3DN`` >=20 > Set the number of forwarding cores, > -- > 2.9.4