From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [RFC] New CLI for DPDK Date: Tue, 28 Mar 2017 12:06:30 +0200 Message-ID: <1976507.q6Vb44MXhO@xps13> References: <20170324140954.356e3755@platinum> <5CD3E4F5-4284-4D68-8008-642E9C3685B3@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Cc: dev@dpdk.org, Olivier Matz , techboard@dpdk.org To: "Wiles, Keith" Return-path: Received: from mail-wr0-f173.google.com (mail-wr0-f173.google.com [209.85.128.173]) by dpdk.org (Postfix) with ESMTP id 568F1D08E for ; Tue, 28 Mar 2017 12:06:35 +0200 (CEST) Received: by mail-wr0-f173.google.com with SMTP id w11so79867488wrc.3 for ; Tue, 28 Mar 2017 03:06:35 -0700 (PDT) In-Reply-To: <5CD3E4F5-4284-4D68-8008-642E9C3685B3@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 2017-03-24 14:48, Wiles, Keith: >=20 > > On Mar 24, 2017, at 8:09 AM, Olivier Matz = wrote: > >=20 > > Hi Keith, > >=20 > > On Thu, 23 Mar 2017 16:13:21 +0000, "Wiles, Keith" wrote: > >>> On Mar 10, 2017, at 9:25 AM, Wiles, Keith = wrote: > >>>=20 > >>> I would like to request for comments on a new CLI design and get = any feedback. I have attached the cli.rst text, which is still a work i= n progress for you review. > >>>=20 > >>> I have also ported the CLI to a version of Pktgen on the =E2=80=98= dev=E2=80=99 branch of the repo in DPDK.org. > >>>=20 > >>> http://dpdk.org/browse/apps/pktgen-dpdk/refs/?h=3Ddev > >>>=20 > >>> I would like to submit the CLI library to be used in DPDK, if tha= t seems reasonable to everyone. I need more testing of the API and Pktg= en, but I feel it has a simpler design, easier to understand and hopefu= lly make it easier for developers to add commands. > >>>=20 > >>> As an example I quickly converted over testpmd from CMDLINE to CL= I (I just add a -I option to select CLI instead) and reduced the test-p= md/cmdline.c file from 12.6K lines to about 4.5K lines. I did not fully= test the code, but the ones I did test seem to work. > >>>=20 > >>> I do not expect DPDK to convert to the new CLI only if it makes s= ense and I am not suggesting to replace CMDLINE library. > >>>=20 > >>> If you play with the new CLI in pktgen and see any problems or wa= nt to suggest new features or changes please let me know. > >>>=20 > >>> Comments on the cli.rst text is also welcome, but the cli.rst is = not complete. I think this file needs to be broken into two one to expl= ain the example and another to explain CLI internals. =20 > >>=20 > >> Any more comments on the CLI code for DPDK. > >>=20 > >> Should I submit a patch for DPDK or would it be better to push thi= s into its own repo on DPDK? > >>=20 > >=20 > > I agree that there is a large possibility of improvements in librte= _cmdline. > >=20 > > Just for reference, I think this design was not that bad at the tim= e it > > was introduced: > > - declaring commands as static variables makes sense when running o= n > > baremetal without malloc library > > - implementing a readline-like part was also needed because not ava= ilable > > on baremetal > > - masking structures to the user was harder due to the lack of mall= oc > > - having a cli is really helpful for a program like testpmd (both f= or > > a user or for an automatic test program) >=20 > I agree, but we do need to use a better version. >=20 > >=20 > > Few efforts were made to enhance this library because it's not the = heart > > of dpdk. >=20 > True CLI is not the heart of DPDK, but adding a better supported CLI = could be a reasonable addition to DPDK for developers to create a real = produce instead of cmdline, which is stated was not a CLI for a real pr= oduct. We can ask to the techboard whether CLI is in DPDK scope. My position: it is neither in the scope of the repo nor in the scope of= dpdk.org. > > The current status is acceptable to me: this library is mostly used= > > internally in dpdk for test apps, and application developers are fr= ee > > to use a better one if they want. > >=20 > > But adding another cli lib in dpdk does not make sense to me. I thi= nk > > the proper direction would be to remove the cli from dpdk and use a= > > good cli library that is available in distros. But for that: > > - we need to find one > > - we need to update all examples/tests that use the cmdline, and > > that will be a lot of work > > - we need to enhance dpdk framework to better manage deps with > > external libraries I agree we could convert testpmd and examples to a new CLI lib. Then we could remove librte_cmdline from DPDK. > Replacing applications with a new CLI is background work and we do no= t need to toss out cmdline until all have been converted, which could t= ake a while. We can move cmdline out of DPDK, but the problem is most o= f the current applications require cmdline and the developer would be r= equired to pull DPDK and cmdline. I would suggest we have both in DPDK = and slowly convert the apps to use the new CLI. >=20 > If we split up DPDK repo into smaller repos and use something like th= e =E2=80=98repo=E2=80=99 command with a catalog file then it would be m= ostly transparent to the developer we have multiple repos. Until that d= ay it does seem more reasonable to have CLI in DPDK repo, but I am will= ing to have it in a different repo for now. It is reasonnable for an application to have some dependencies. It is commonly managed in three ways: - detect the lib on the system - download the lib as part of the build process - ask user to download it > > So, in my opinion, the CLI you are proposing should be hosted on an= other > > repo. >=20 > I will contact Thomas to setup a new repo for the CLI. We had a private discussion. I have tried to put here my conclusions.