From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id C034F8DF0 for ; Wed, 14 Mar 2018 18:38:50 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Mar 2018 10:38:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,306,1517904000"; d="scan'208";a="33854310" Received: from irsmsx152.ger.corp.intel.com ([163.33.192.66]) by FMSMGA003.fm.intel.com with ESMTP; 14 Mar 2018 10:38:48 -0700 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.221]) by IRSMSX152.ger.corp.intel.com ([169.254.6.52]) with mapi id 14.03.0319.002; Wed, 14 Mar 2018 17:38:47 +0000 From: "Ananyev, Konstantin" To: "Zhang, Qi Z" , "thomas@monjalon.net" CC: "dev@dpdk.org" , "Xing, Beilei" , "Wu, Jingjing" , "Lu, Wenzhuo" , "Zhang, Qi Z" Thread-Topic: [dpdk-dev] [PATCH v2 2/4] app/testpmd: add parameters for deferred queue setup Thread-Index: AQHTsdzcss/TZkVmnEWTWqXf7WhGTaPQEjtw Date: Wed, 14 Mar 2018 17:38:46 +0000 Message-ID: <2601191342CEEE43887BDE71AB9772589E28FD01@irsmsx105.ger.corp.intel.com> References: <20180212045314.171616-1-qi.z.zhang@intel.com> <20180302041306.90324-1-qi.z.zhang@intel.com> <20180302041306.90324-3-qi.z.zhang@intel.com> In-Reply-To: <20180302041306.90324-3-qi.z.zhang@intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOGRmYjQ2ZTctNzkyOS00YjllLThjOTktMmJkMjcyNDdiNzliIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6InVCTTQ3bGFQM2hkTHN0TTAxSWR5UEtGRXNpdEtvUzVwQXZUM2pZRnFxRXM9In0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2 2/4] app/testpmd: add parameters for deferred queue setup 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: Wed, 14 Mar 2018 17:38:51 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Qi Zhang > Sent: Friday, March 2, 2018 4:13 AM > To: thomas@monjalon.net > Cc: dev@dpdk.org; Xing, Beilei ; Wu, Jingjing ; Lu, Wenzhuo ; > Zhang, Qi Z > Subject: [dpdk-dev] [PATCH v2 2/4] app/testpmd: add parameters for deferr= ed queue setup >=20 > Add two parameters: > rxq-setup: set the number of RX queues be setup before device started > txq-setup: set the number of TX queues be setup before device started. Not sure we do need these new parameters at all - in next patch you introduce ability to do queue_setup from command-line. Plus we already have an ability to do queue_stop/queue_start from command-l= ine. I think that would be enough for testing. Konstantin =20 >=20 > Signed-off-by: Qi Zhang > --- > app/test-pmd/parameters.c | 29 +++++++++++++++++++++++++++++ > app/test-pmd/testpmd.c | 8 ++++++-- > app/test-pmd/testpmd.h | 2 ++ > doc/guides/testpmd_app_ug/run_app.rst | 12 ++++++++++++ > 4 files changed, 49 insertions(+), 2 deletions(-) >=20 > diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c > index 97d22b860..497259ee7 100644 > --- a/app/test-pmd/parameters.c > +++ b/app/test-pmd/parameters.c > @@ -146,8 +146,12 @@ usage(char* progname) > printf(" --rss-ip: set RSS functions to IPv4/IPv6 only .\n"); > printf(" --rss-udp: set RSS functions to IPv4/IPv6 + UDP.\n"); > printf(" --rxq=3DN: set the number of RX queues per port to N.\n"); > + printf(" --rxq-setup=3DN: set the number of RX queues be setup before" > + "device start to N.\n"); > printf(" --rxd=3DN: set the number of descriptors in RX rings to N.\n"= ); > printf(" --txq=3DN: set the number of TX queues per port to N.\n"); > + printf(" --txq-setup=3DN: set the number of TX queues be setup before" > + "device start to N.\n"); > printf(" --txd=3DN: set the number of descriptors in TX rings to N.\n"= ); > printf(" --burst=3DN: set the number of packets per burst to N.\n"); > printf(" --mbcache=3DN: set the cache of mbuf memory pool to N.\n"); > @@ -596,7 +600,9 @@ launch_args_parse(int argc, char** argv) > { "rss-ip", 0, 0, 0 }, > { "rss-udp", 0, 0, 0 }, > { "rxq", 1, 0, 0 }, > + { "rxq-setup", 1, 0, 0 }, > { "txq", 1, 0, 0 }, > + { "txq-setup", 1, 0, 0 }, > { "rxd", 1, 0, 0 }, > { "txd", 1, 0, 0 }, > { "burst", 1, 0, 0 }, > @@ -933,6 +939,15 @@ launch_args_parse(int argc, char** argv) > " >=3D 0 && <=3D %u\n", n, > get_allowed_max_nb_rxq(&pid)); > } > + if (!strcmp(lgopts[opt_idx].name, "rxq-setup")) { > + n =3D atoi(optarg); > + if (n >=3D 0 && check_nb_rxq((queueid_t)n) =3D=3D 0) > + nb_rxq_setup =3D (queueid_t) n; > + else > + rte_exit(EXIT_FAILURE, "rxq-setup %d invalid - must be" > + " >=3D 0 && <=3D %u\n", n, > + get_allowed_max_nb_rxq(&pid)); > + } > if (!strcmp(lgopts[opt_idx].name, "txq")) { > n =3D atoi(optarg); > if (n >=3D 0 && check_nb_txq((queueid_t)n) =3D=3D 0) > @@ -942,6 +957,15 @@ launch_args_parse(int argc, char** argv) > " >=3D 0 && <=3D %u\n", n, > get_allowed_max_nb_txq(&pid)); > } > + if (!strcmp(lgopts[opt_idx].name, "txq-setup")) { > + n =3D atoi(optarg); > + if (n >=3D 0 && check_nb_txq((queueid_t)n) =3D=3D 0) > + nb_txq_setup =3D (queueid_t) n; > + else > + rte_exit(EXIT_FAILURE, "txq-setup %d invalid - must be" > + " >=3D 0 && <=3D %u\n", n, > + get_allowed_max_nb_txq(&pid)); > + } > if (!nb_rxq && !nb_txq) { > rte_exit(EXIT_FAILURE, "Either rx or tx queues should " > "be non-zero\n"); > @@ -1119,4 +1143,9 @@ launch_args_parse(int argc, char** argv) > /* Set offload configuration from command line parameters. */ > rx_mode.offloads =3D rx_offloads; > tx_mode.offloads =3D tx_offloads; > + > + if (nb_rxq_setup > nb_rxq) > + nb_rxq_setup =3D nb_rxq; > + if (nb_txq_setup > nb_txq) > + nb_txq_setup =3D nb_txq; > } > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c > index 46dc22c94..790e7359c 100644 > --- a/app/test-pmd/testpmd.c > +++ b/app/test-pmd/testpmd.c > @@ -207,6 +207,10 @@ uint8_t dcb_test =3D 0; > */ > queueid_t nb_rxq =3D 1; /**< Number of RX queues per port. */ > queueid_t nb_txq =3D 1; /**< Number of TX queues per port. */ > +queueid_t nb_rxq_setup =3D MAX_QUEUE_ID; > +/**< Number of RX queues per port start when dev_start. */ > +queueid_t nb_txq_setup =3D MAX_QUEUE_ID; > +/**< Number of TX queues per port start when dev_start */ >=20 > /* > * Configurable number of RX/TX ring descriptors. > @@ -1594,7 +1598,7 @@ start_port(portid_t pid) > /* Apply Tx offloads configuration */ > port->tx_conf.offloads =3D port->dev_conf.txmode.offloads; > /* setup tx queues */ > - for (qi =3D 0; qi < nb_txq; qi++) { > + for (qi =3D 0; qi < nb_txq_setup; qi++) { > if ((numa_support) && > (txring_numa[pi] !=3D NUMA_NO_CONFIG)) > diag =3D rte_eth_tx_queue_setup(pi, qi, > @@ -1622,7 +1626,7 @@ start_port(portid_t pid) > /* Apply Rx offloads configuration */ > port->rx_conf.offloads =3D port->dev_conf.rxmode.offloads; > /* setup rx queues */ > - for (qi =3D 0; qi < nb_rxq; qi++) { > + for (qi =3D 0; qi < nb_rxq_setup; qi++) { > if ((numa_support) && > (rxring_numa[pi] !=3D NUMA_NO_CONFIG)) { > struct rte_mempool * mp =3D > diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h > index 153abea05..1a423eb8c 100644 > --- a/app/test-pmd/testpmd.h > +++ b/app/test-pmd/testpmd.h > @@ -373,6 +373,8 @@ extern uint64_t rss_hf; >=20 > extern queueid_t nb_rxq; > extern queueid_t nb_txq; > +extern queueid_t nb_rxq_setup; > +extern queueid_t nb_txq_setup; >=20 > extern uint16_t nb_rxd; > extern uint16_t nb_txd; > diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_a= pp_ug/run_app.rst > index 1fd53958a..63dbec407 100644 > --- a/doc/guides/testpmd_app_ug/run_app.rst > +++ b/doc/guides/testpmd_app_ug/run_app.rst > @@ -354,6 +354,12 @@ The commandline options are: > Set the number of RX queues per port to N, where 1 <=3D N <=3D 65535= . > The default value is 1. >=20 > +* ``--rxq-setup=3DN`` > + > + Set the number of RX queues will be setup before device started, > + where 0 <=3D N <=3D 65535. The default value is rxq, if the number i= s > + larger than rxq, it will be set to rxq automatically. > + > * ``--rxd=3DN`` >=20 > Set the number of descriptors in the RX rings to N, where N > 0. > @@ -364,6 +370,12 @@ The commandline options are: > Set the number of TX queues per port to N, where 1 <=3D N <=3D 65535= . > The default value is 1. >=20 > +* ``--txq-setup=3DN`` > + > + Set the number of TX queues will be setup before device started, > + where 0 <=3D N <=3D 65535. The default value is rxq, if the number i= s > + larger than txq, it will be set to txq automatically. > + > * ``--txd=3DN`` >=20 > Set the number of descriptors in the TX rings to N, where N > 0. > -- > 2.13.6