From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f173.google.com (mail-pf0-f173.google.com [209.85.192.173]) by dpdk.org (Postfix) with ESMTP id 9BD2258FA for ; Fri, 10 Mar 2017 17:41:03 +0100 (CET) Received: by mail-pf0-f173.google.com with SMTP id w189so43731923pfb.0 for ; Fri, 10 Mar 2017 08:41:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AgIoCvypvtYjMLQe7QwNrv5ze1KO6wUul9bnQdSUA9M=; b=uUSkAlfKu/hIsx+0NS14uVbc8QtBxeUFbrU8admE1V6A8TYc8j5Gs9bq2CVpv9k55P z4TUBGMyqI+V5TtfgeT8lTtN5VKLl4rzWjvWRvIup2W45NVdYtSPCgFw2VSdbivPvqzo AKBS+FOqMvEmM6oQPLUD8lcqv8rXuQjzwH1paW3bnWMhusAxkLszWaoonYj2cfy6QA3u rXYpb4zs2bEuQzFoXraLU3TwGmnjgYUeVB1k0MxvMxLO21HyKBLVSSbMZsbhBZL+om0X WUgztzhWAFLygiAy11kxP+3XZBSe203qxpLOfMCShlOaUdDuKrvULfTPNmu2CDbyTTRj Z1hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AgIoCvypvtYjMLQe7QwNrv5ze1KO6wUul9bnQdSUA9M=; b=qim7NcH/Wsj1bFEN6BiLKrzMWy9AUeyXH4dKyXkuLd3ILqpGk1omGQCL7Qolwx7M9u dySR5KKz0/yJBDiOYaSaor7EK8qotbXhVBjgHQFwcDq2DS0KA1Fe2rBwGqY4bHYRlKwm Kj0UavOXYT3D72M98z8RVp/NRMr1UFLN38qk0voOHV0QUlBoxfUvsG1kxfLS8Y9bWfis OXCvdDO4P4Gwc7xhi0MsDdISQ3mCEMffcwPE7ARd6+yXQcTjAd4iVeY38u6WRvwJx4AZ M2wFOuvtUfMx2BFHzfOxOy27NPc0mNCGk7/aRjiDZEepLmRIDMNcRAmKmYsZQUmNdFcV 4xuQ== X-Gm-Message-State: AMke39lmBb1Bv5EuG9ZcIG6l24kyUBfBxoVNEp6WIz4n9d7bTdMc3MymUQJxheiGeYwjiQ== X-Received: by 10.84.173.228 with SMTP id p91mr26683484plb.121.1489164062804; Fri, 10 Mar 2017 08:41:02 -0800 (PST) Received: from xeon-e3 (204-195-18-65.wavecable.com. [204.195.18.65]) by smtp.gmail.com with ESMTPSA id s12sm19707191pfj.9.2017.03.10.08.41.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 Mar 2017 08:41:02 -0800 (PST) Date: Fri, 10 Mar 2017 08:41:01 -0800 From: Stephen Hemminger To: "Wiles, Keith" Cc: DPDK Message-ID: <20170310084101.1499aece@xeon-e3> In-Reply-To: References: <20170310080604.66c9f168@xeon-e3> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [RFC] New CLI for DPDK 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: Fri, 10 Mar 2017 16:41:03 -0000 On Fri, 10 Mar 2017 16:22:49 +0000 "Wiles, Keith" wrote: > > On Mar 10, 2017, at 10:06 AM, Stephen Hemminger wrote: > >=20 > > On Fri, 10 Mar 2017 15:25:31 +0000 > > "Wiles, Keith" wrote: > > =20 > >> I would like to request for comments on a new CLI design and get any f= eedback. I have attached the cli.rst text, which is still a work in progres= s for you review. > >>=20 > >> I have also ported the CLI to a version of Pktgen on the =E2=80=98dev= =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 that see= ms reasonable to everyone. I need more testing of the API and Pktgen, but I= feel it has a simpler design, easier to understand and hopefully make it e= asier for developers to add commands. > >>=20 > >> As an example I quickly converted over testpmd from CMDLINE to CLI (I = just add a -I option to select CLI instead) and reduced the test-pmd/cmdlin= e.c file from 12.6K lines to about 4.5K lines. I did not fully test the cod= e, 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 sense = and I am not suggesting to replace CMDLINE library. > >>=20 > >> If you play with the new CLI in pktgen and see any problems or want 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 c= omplete. I think this file needs to be broken into two one to explain the e= xample and another to explain CLI internals. > >> =20 > >=20 > > It would be great if all DPDK examples used a similar architecture. And= having a common > > infrastructure would help. > >=20 > > But not sure it needs to be special. Why should this be DPDK specific? > > What you are building really ends up being an application > > framework at some point. Surely, there are lots of others already in op= en source. > >=20 > > Heck even VPP has its own CLI inside. =20 >=20 > I have been looking for one for years and never found one that met my nee= ds of easy to use and easy to understand. If you can find a better one then= please let me know. >=20 > This code does use some DPDK APIs but they can be removed to make it stan= dalone and the first version I did was standalone. Some of the ones I found= were similar to cmdline and some took it a step farther by trying to do ev= erything one would ever need in a CLI. Those are way too big and difficult = to use, then you have the ones that are barely a step above readline or jus= t writing you own. The cmdline interface falls closer to the trying to do e= verything for you, by converting strings into values with structures/macros= difficult to understand at a glance. IMHO this one is simple and easy to u= nderstand. >=20 > But in truth the cmdline interface in DPDK is difficult to use and to wri= te code for, takes way to many lines of code to make a simple command. The = current Cmdline is also not dynamic, which makes it difficult to add featu= res on the fly. >=20 > All of the commands are at the same level and using a directory structure= allows the developer to use what directory path he takes to denote a conte= xt for the command. As the example of converting test-pmd to use CLI the nu= mber of lines dropped from 12.6K to 4.5K lines. The cmdline code is also no= t consider to be production quality (from the docs) and I would like to fix= that problem for DPDK. >=20 If you look beyond the simple C model there are a lot. TCL http://wanderinghorse.net/computing/shellish/eshell.html Though these may not match what is needed. Agree that the current cmdline(= ) method is not suitable.