From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id E21878D8B for ; Fri, 5 Feb 2016 09:49:06 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 05 Feb 2016 00:49:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,399,1449561600"; d="scan'208";a="877610796" Received: from irsmsx110.ger.corp.intel.com ([163.33.3.25]) by orsmga001.jf.intel.com with ESMTP; 05 Feb 2016 00:49:01 -0800 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.102]) by irsmsx110.ger.corp.intel.com ([169.254.15.31]) with mapi id 14.03.0248.002; Fri, 5 Feb 2016 08:49:00 +0000 From: "De Lara Guarch, Pablo" To: "Pattan, Reshma" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH 1/5] app/test-pmd: fix nb_rxq and np_txq checks Thread-Index: AQHRWpaLKBDfV6+Xa0CmWD58aUp5sZ8dLYVw Date: Fri, 5 Feb 2016 08:48:59 +0000 Message-ID: References: <1454073052-27025-1-git-send-email-reshma.pattan@intel.com> <1454073052-27025-2-git-send-email-reshma.pattan@intel.com> In-Reply-To: <1454073052-27025-2-git-send-email-reshma.pattan@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZWE0NjIyZWMtMTI3Mi00ODU1LWEzNzctMWU1NGYzYjg2N2UxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjQuMTAuMTkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiaUo5ZU5ScjFYMStqK1hNT200SFk4SWkwcFFabFRWTkgrRkVVTUpcL1U4YlE9In0= 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 1/5] app/test-pmd: fix nb_rxq and np_txq checks 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: Fri, 05 Feb 2016 08:49:07 -0000 Hi Reshma, > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Reshma Pattan > Sent: Friday, January 29, 2016 1:11 PM > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH 1/5] app/test-pmd: fix nb_rxq and np_txq check= s >=20 > Made testpmd changes to validate nb_rxq/nb_txq zero > value changes of librte_ether. >=20 > Signed-off-by: Reshma Pattan > --- > app/test-pmd/cmdline.c | 11 +++++------ > app/test-pmd/parameters.c | 14 +++++++++----- > app/test-pmd/testpmd.c | 19 +++++++++++++++++-- > 3 files changed, 31 insertions(+), 13 deletions(-) >=20 > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c > index 6d28c1b..fa666d2 100644 > --- a/app/test-pmd/cmdline.c > +++ b/app/test-pmd/cmdline.c > @@ -1,7 +1,7 @@ > /*- > * BSD LICENSE > * > - * Copyright(c) 2010-2015 Intel Corporation. All rights reserved. > + * Copyright(c) 2010-2016 Intel Corporation. All rights reserved. > * Copyright(c) 2014 6WIND S.A. > * All rights reserved. > * > @@ -1163,17 +1163,16 @@ cmd_config_rx_tx_parsed(void *parsed_result, > printf("Please stop all ports first\n"); > return; > } > - > if (!strcmp(res->name, "rxq")) { > - if (res->value <=3D 0) { > - printf("rxq %d invalid - must be > 0\n", res->value); > + if (!res->value && !nb_txq) { > + printf("Warning: Either rx or tx queues should non be > zero\n"); Typo: Either "should be non-zero" or "should not be zero". Same below. > return; > } > nb_rxq =3D res->value; > } > else if (!strcmp(res->name, "txq")) { > - if (res->value <=3D 0) { > - printf("txq %d invalid - must be > 0\n", res->value); > + if (!res->value && !nb_rxq) { > + printf("Warning: Either rx or tx queues should non be > zero\n"); > return; > } > nb_txq =3D res->value; [...] > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c > index 1319917..4c8afba 100644 > --- a/app/test-pmd/testpmd.c > +++ b/app/test-pmd/testpmd.c > @@ -1,7 +1,7 @@ > /*- > * BSD LICENSE > * > - * Copyright(c) 2010-2015 Intel Corporation. All rights reserved. > + * Copyright(c) 2010-2016 Intel Corporation. All rights reserved. > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > @@ -608,6 +608,7 @@ init_fwd_streams(void) > portid_t pid; > struct rte_port *port; > streamid_t sm_id, nb_fwd_streams_new; > + queueid_t q; >=20 > /* set socket id according to numa or not */ > FOREACH_PORT(pid, ports) { > @@ -643,7 +644,12 @@ init_fwd_streams(void) > } > } >=20 > - nb_fwd_streams_new =3D (streamid_t)(nb_ports * nb_rxq); > + q =3D RTE_MAX(nb_rxq, nb_txq); > + if (q =3D=3D 0) { > + printf("Fail:Cannot allocate fwd streams as number of > queues is 0\n"); > + return -1; > + } > + nb_fwd_streams_new =3D (streamid_t)(nb_ports * q); > if (nb_fwd_streams_new =3D=3D nb_fwd_streams) > return 0; > /* clear the old */ > @@ -955,6 +961,12 @@ start_packet_forwarding(int with_tx_first) > portid_t pt_id; > streamid_t sm_id; >=20 > + if (strcmp(cur_fwd_eng->fwd_mode_name, "rxonly") =3D=3D 0 && > !nb_rxq) > + rte_exit(EXIT_FAILURE, "rxq are 0, cannot use rxonly fwd > mode\n"); > + > + if (strcmp(cur_fwd_eng->fwd_mode_name, "txonly") =3D=3D 0 && > !nb_txq) > + rte_exit(EXIT_FAILURE, "txq are 0, cannot use txonly fwd > mode\n"); > + Should we check if we have both rxq and txq > 0 when running the other forwarding modes that need both RX/TX queues? > if (all_ports_started() =3D=3D 0) { > printf("Not all ports were started\n"); > return; > @@ -2037,6 +2049,9 @@ main(int argc, char** argv) > if (argc > 1) > launch_args_parse(argc, argv); >=20 > + if (!nb_rxq && !nb_txq) > + printf("Warning: Either rx or tx queues should be non- > zero\n"); > + > if (nb_rxq > nb_txq) > printf("Warning: nb_rxq=3D%d enables RSS configuration, " > "but nb_txq=3D%d will prevent to fully test it.\n", Since we are allowing testpmd to run with nb_txq =3D 0, if nb_rxq =3D 1 and= nb_txq =3D 0, this warning above will be showed, because before if nb_rxq > nb_txq, it would mean that nb_rxq is at least 2, so RSS is enabled, but now it migh= t not be, so this message has to be changed. > -- > 1.7.4.1