From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Ananyev, Konstantin" Subject: Re: [PATCH v2 2/4] app/testpmd: add parameters for deferred queue setup Date: Thu, 15 Mar 2018 13:42:05 +0000 Message-ID: <2601191342CEEE43887BDE71AB9772589E290245@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> <2601191342CEEE43887BDE71AB9772589E28FD01@irsmsx105.ger.corp.intel.com> <039ED4275CED7440929022BC67E706115316DF65@SHSMSX103.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" , "Xing, Beilei" , "Wu, Jingjing" , "Lu, Wenzhuo" To: "Zhang, Qi Z" , "thomas@monjalon.net" Return-path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id E7DA15F5F for ; Thu, 15 Mar 2018 14:42:09 +0100 (CET) In-Reply-To: <039ED4275CED7440929022BC67E706115316DF65@SHSMSX103.ccr.corp.intel.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: Zhang, Qi Z > Sent: Thursday, March 15, 2018 3:58 AM > To: Ananyev, Konstantin ; thomas@monjalon.n= et > Cc: dev@dpdk.org; Xing, Beilei ; Wu, Jingjing ; Lu, Wenzhuo > Subject: RE: [dpdk-dev] [PATCH v2 2/4] app/testpmd: add parameters for de= ferred queue setup >=20 >=20 >=20 > > -----Original Message----- > > From: Ananyev, Konstantin > > Sent: Thursday, March 15, 2018 1:39 AM > > To: Zhang, Qi Z ; thomas@monjalon.net > > Cc: dev@dpdk.org; Xing, Beilei ; Wu, Jingjing > > ; Lu, Wenzhuo ; Zhang, Qi = Z > > > > Subject: RE: [dpdk-dev] [PATCH v2 2/4] app/testpmd: add parameters for > > deferred queue setup > > > > > > > > > -----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 > > > deferred queue setup > > > > > > 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-line. > > I think that would be enough for testing. > > Konstantin >=20 > Without these parameters, we can only reconfigure a queue after dev_start= , but not the case that deferred configure a fresh queue. We do have: port stop port config all (rxq|txq) (value) port start If we'll add a new command to specify which queues should be deferred at de= v_start - wouldn't that be enough? >=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(-) > > > > > > 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 bef= ore" > > > + "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 bef= ore" > > > + "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 */ > > > > > > /* > > > * 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; > > > > > > extern queueid_t nb_rxq; > > > extern queueid_t nb_txq; > > > +extern queueid_t nb_rxq_setup; > > > +extern queueid_t nb_txq_setup; > > > > > > 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_app_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 6= 5535. > > > The default value is 1. > > > > > > +* ``--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 numb= er is > > > + larger than rxq, it will be set to rxq automatically. > > > + > > > * ``--rxd=3DN`` > > > > > > 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 6= 5535. > > > The default value is 1. > > > > > > +* ``--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 numb= er is > > > + larger than txq, it will be set to txq automatically. > > > + > > > * ``--txd=3DN`` > > > > > > Set the number of descriptors in the TX rings to N, where N > 0. > > > -- > > > 2.13.6