From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f42.google.com (mail-wm0-f42.google.com [74.125.82.42]) by dpdk.org (Postfix) with ESMTP id A2F6A69A5 for ; Fri, 24 Mar 2017 14:09:58 +0100 (CET) Received: by mail-wm0-f42.google.com with SMTP id n11so1854667wma.0 for ; Fri, 24 Mar 2017 06:09:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gfq5FCaj7vBQw18aBzrC8wcCHGhzP96jw+z4BzvlahI=; b=0CdeV8eMP+AfXLG5fZZeShmOkAMxn66NPw31gj+gBzowXkvBQ52zFuELTgkE8zXOgO +SRoHSXayJU6rfc+bDKRwmK0HGTkV7mT/NpJjDA66ygXT5rFG7qgMSV8eHropop4Hz6l sGMJEFiWsEv6pYrEIxmwf3S/By3Ci1ex7I0f58d+i6nloQQ6e1bB9QhPsOMkbjC54DI2 BmG46CNGb3yOXvblA0ZWzjcFHY+bFrcT1B0IwkElffRuCzUTs5jUHX6MMpGVBrDNjNCi MJc8VttePBasTj7Bu8LGKU6GKUF3MI6a5e1vQNJcEuboRY4WL/U9eTYW53xfIx9bS9Rr 1UHA== 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=gfq5FCaj7vBQw18aBzrC8wcCHGhzP96jw+z4BzvlahI=; b=EpnAFhXvx56HXQjbwP6RE+fJ4BjxWxIjCu7jDxNNFfudzV9PbjGrzbks6e6PGbYrAY Wi/2JBC5yNZEYZpBHVlzkpc3jqj2yExJ2NqItFPar/Vl0u8Y9qz6jRWBf5/orgfzYfOV bH0Qawokd0yu1FGwm9qrV+wRTbckZ1Uvka9RFx0fuf8p07rI7oQ7TrQYYrdjUYgFYOI1 76YwtpeTSQ8qumiJ3UMjfF/im1P7k6wOMqwBucvPGPc4d44CvYBPOhy36ysuudtdCzb9 6CxvBqa3UgF2RfWxNW0JOUMhWavgdD8nwqPmfOXbzF+iTmenm/MTdvusyOOxZH0OeXNw yrRg== X-Gm-Message-State: AFeK/H1nsThLYmm1t67JYMaSm2rX/cWu75qFICGeUncyb4rpbQKb8Ssbwqu4oJjuix6jHBD0 X-Received: by 10.28.103.3 with SMTP id b3mr2794985wmc.99.1490360998206; Fri, 24 Mar 2017 06:09:58 -0700 (PDT) Received: from platinum (2a01cb0c03c651000226b0fffeed02fc.ipv6.abo.wanadoo.fr. [2a01:cb0c:3c6:5100:226:b0ff:feed:2fc]) by smtp.gmail.com with ESMTPSA id l90sm2392573wmi.25.2017.03.24.06.09.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 24 Mar 2017 06:09:57 -0700 (PDT) Date: Fri, 24 Mar 2017 14:09:54 +0100 From: Olivier Matz To: "Wiles, Keith" Cc: DPDK Message-ID: <20170324140954.356e3755@platinum> In-Reply-To: References: X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) 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, 24 Mar 2017 13:09:58 -0000 Hi Keith, 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 fe= edback. I have attached the cli.rst text, which is still a work in progress= 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 seem= s 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 ea= sier for developers to add commands. > >=20 > > As an example I quickly converted over testpmd from CMDLINE to CLI (I j= ust add a -I option to select CLI instead) and reduced the test-pmd/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 sense a= nd 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 co= mplete. I think this file needs to be broken into two one to explain the ex= ample 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 this into = its own repo on DPDK? >=20 I agree that there is a large possibility of improvements in librte_cmdline. Just for reference, I think this design was not that bad at the time it was introduced: - declaring commands as static variables makes sense when running on baremetal without malloc library - implementing a readline-like part was also needed because not available on baremetal - masking structures to the user was harder due to the lack of malloc - having a cli is really helpful for a program like testpmd (both for a user or for an automatic test program) Few efforts were made to enhance this library because it's not the heart of dpdk. The current status is acceptable to me: this library is mostly used internally in dpdk for test apps, and application developers are free to use a better one if they want. But adding another cli lib in dpdk does not make sense to me. I think 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 So, in my opinion, the CLI you are proposing should be hosted on another repo. Regards, Olivier