From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 140276904 for ; Thu, 28 Jun 2018 15:45:14 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Jun 2018 06:45:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,283,1526367600"; d="scan'208";a="52594734" Received: from irsmsx151.ger.corp.intel.com ([163.33.192.59]) by orsmga007.jf.intel.com with ESMTP; 28 Jun 2018 06:45:12 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.139]) by IRSMSX151.ger.corp.intel.com ([169.254.4.216]) with mapi id 14.03.0319.002; Thu, 28 Jun 2018 14:45:11 +0100 From: "Iremonger, Bernard" To: "Singh, Jasvinder" , "dev@dpdk.org" CC: "Dumitrescu, Cristian" , "Pattan, Reshma" Thread-Topic: [PATCH v3 23/23] app/testpmd: rework softnic forward mode Thread-Index: AQHUDjRlbMFZ4TLsA0ux67mWnI31O6R1rgUQ Date: Thu, 28 Jun 2018 13:45:10 +0000 Message-ID: <8CEF83825BEC744B83065625E567D7C260CBA41E@IRSMSX108.ger.corp.intel.com> References: <20180615165224.25004-2-jasvinder.singh@intel.com> <20180627163123.135686-1-jasvinder.singh@intel.com> <20180627163123.135686-24-jasvinder.singh@intel.com> In-Reply-To: <20180627163123.135686-24-jasvinder.singh@intel.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZTdmZmI0MzYtOTA2ZS00ZDNiLTgyZWEtNDc3NzhiZjU0ODRjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiUjVUVzNHdzRIUjBMbHB0elNYUFRLOU13RTVGWGhJOHBkRiszbUVnQjY4NnFYN2JDVEdVckFVNVpGRDltUENlUiJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action 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 23/23] app/testpmd: rework softnic forward mode 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, 28 Jun 2018 13:45:15 -0000 Hi Jasvinder, > -----Original Message----- > From: Singh, Jasvinder > Sent: Wednesday, June 27, 2018 5:31 PM > To: dev@dpdk.org > Cc: Dumitrescu, Cristian ; Iremonger, > Bernard ; Pattan, Reshma > > Subject: [PATCH v3 23/23] app/testpmd: rework softnic forward mode >=20 > Modied the testpmd softnic forwarding mode as per the changes in softnic > PMD. >=20 > To run testpmd application with softnic fwd mode, following command is > used; >=20 > $ ./testpmd -c 0xc -n 4 --vdev 'net_softnic0,firmware=3Dscript.cli' > -- -i --forward-mode=3Dsoftnic >=20 > Signed-off-by: Jasvinder Singh > Signed-off-by: Reshma Pattan > --- > app/test-pmd/Makefile | 4 +- > app/test-pmd/cmdline.c | 54 ++++- > app/test-pmd/config.c | 57 +++++ > app/test-pmd/{tm.c =3D> softnicfwd.c} | 405 +++++++++++-----------------= ------ > -- > app/test-pmd/testpmd.c | 29 +-- > app/test-pmd/testpmd.h | 44 +--- > 6 files changed, 248 insertions(+), 345 deletions(-) rename app/test- > pmd/{tm.c =3D> softnicfwd.c} (61%) > > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index > 27e2aa8..3fcbc17 100644 > --- a/app/test-pmd/cmdline.c > +++ b/app/test-pmd/cmdline.c > @@ -69,6 +69,9 @@ > #ifdef RTE_LIBRTE_I40E_PMD > #include > #endif > +#ifdef RTE_LIBRTE_PMD_SOFTNIC > +#include > +#endif > #ifdef RTE_LIBRTE_BNXT_PMD > #include > #endif > @@ -14806,20 +14809,14 @@ static void > cmd_set_port_tm_hierarchy_default_parsed(void *parsed_result, >=20 > p =3D &ports[port_id]; >=20 > - /* Port tm flag */ > - if (p->softport.tm_flag =3D=3D 0) { > - printf(" tm not enabled on port %u (error)\n", port_id); > - return; > - } > - > /* Forward mode: tm */ Should "tm" be replaced by "softnic" in line above. =20 > - if (strcmp(cur_fwd_config.fwd_eng->fwd_mode_name, "tm")) { > - printf(" tm mode not enabled(error)\n"); > + if (strcmp(cur_fwd_config.fwd_eng->fwd_mode_name, "softnic")) { > + printf(" softnicfwd mode not enabled(error)\n"); > return; > } >=20 > /* Set the default tm hierarchy */ > - p->softport.tm.default_hierarchy_enable =3D 1; > + p->softport.default_tm_hierarchy_enable =3D 1; > } >=20 > cmdline_parse_inst_t cmd_set_port_tm_hierarchy_default =3D { @@ - > 17543,15 +17540,50 @@ cmdline_read_from_file(const char *filename) void > prompt(void) > { > + int status; > + > /* initialize non-constant commands */ > cmd_set_fwd_mode_init(); > cmd_set_fwd_retry_mode_init(); >=20 > +#if defined RTE_LIBRTE_PMD_SOFTNIC > + portid_t softnic_portid, pid; > + uint8_t softnic_enable =3D 0; > + > + if (strcmp(cur_fwd_eng->fwd_mode_name, "softnic") =3D=3D 0) { > + RTE_ETH_FOREACH_DEV(pid) { > + struct rte_port *port =3D &ports[pid]; > + const char *driver =3D port->dev_info.driver_name; > + > + if (strcmp(driver, "net_softnic") =3D=3D 0) { > + softnic_portid =3D pid; > + softnic_enable =3D 1; > + break; > + } > + } > + } > +#endif > + > testpmd_cl =3D cmdline_stdin_new(main_ctx, "testpmd> "); > if (testpmd_cl =3D=3D NULL) > return; > - cmdline_interact(testpmd_cl); > - cmdline_stdin_exit(testpmd_cl); > + > + for (;;) { > + status =3D cmdline_poll(testpmd_cl); > + if (status < 0) > + rte_panic("CLI poll error (%" PRId32 ")\n", status); > + else if (status =3D=3D RDLINE_EXITED) { > + cmdline_stdin_exit(testpmd_cl); > + rte_exit(0, "\n"); > + } > + > +#if defined RTE_LIBRTE_PMD_SOFTNIC > + > + if ((softnic_enable =3D=3D 1) && > + (strcmp(cur_fwd_eng->fwd_mode_name, "softnic") =3D=3D 0)) > + rte_pmd_softnic_manage(softnic_portid); > +#endif > + } > } >=20 Should the testpmd help command be updated for the softnic, lines 125 to = 1136 in cmdline.c ? Regards, Bernard.