From mboxrd@z Thu Jan 1 00:00:00 1970 From: Neil Horman Subject: Re: [RFC] Yet another option for DPDK options Date: Thu, 2 Jun 2016 16:08:37 -0400 Message-ID: <20160602200837.GC12923@hmsreliant.think-freely.org> References: <20160602104106.GA12923@hmsreliant.think-freely.org> <2363376.b1CWhBpcZG@xps13> <75917C44-9CF7-4A0B-B8D3-CD7DC7425D49@intel.com> <20160602171120.GB12923@hmsreliant.think-freely.org> <7091836E-B9D5-4F99-ADDB-A47B4C7B5F7E@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Thomas Monjalon , Yuanhan Liu , "dev@dpdk.org" , "Richardson, Bruce" , "Tan, Jianfeng" , Stephen Hemminger , Christian Ehrhardt , Panu Matilainen , Olivier Matz To: "Wiles, Keith" Return-path: Received: from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58]) by dpdk.org (Postfix) with ESMTP id 77B995A32 for ; Thu, 2 Jun 2016 22:08:53 +0200 (CEST) Content-Disposition: inline In-Reply-To: <7091836E-B9D5-4F99-ADDB-A47B4C7B5F7E@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, Jun 02, 2016 at 07:41:10PM +0000, Wiles, Keith wrote: >=20 > On 6/2/16, 12:11 PM, "Neil Horman" wrote: >=20 > > > >1) The definition of a config structure that can be passed to rte_eal_= init, > >defining the configuration for that running process >=20 > Having a configuration structure means we have to have an ABI change to= that structure anytime we add or remove an option. I was thinking a very= simple DB of some kind would be better. Have the code query the DB to ob= tain the needed information. The APIs used to query and set the DB needs = to be very easy to use as well. Thats a fair point. A decent starting point is likely a simple struct th= at looks like this: struct key_vals { char *key; union { ulong longval; void *ptrval; } value; }; struct config { size_t count; struct key_vals kvp[0]; }; >=20 > Maybe each option can define its own structure if needed or just a simp= le variable type can be used for the basic types (int, string, bool, =E2=80= =A6) >=20 Well, if you have config sections that require mulitiple elements, I'd ha= ndle that with naming, i.e. if you have a config group that has an int and cha= r value, I'd name them "group.intval", and "group.charval", so they are independently searchable, but linked from a nomenclature standpoint. > Would this work better in the long run, does a fixed structure still ma= ke sense? >=20 No. I think you're ABI concerns are valid, but the above is likely a good starting point to address them. Best Neil > > > >2) The creation and use of an API that various DPDK libraries can use = to > >retrieve that structure (or elements thereof), based on some explicit = or imlicit > >id, so that the configuration can be used (I'm thinking here specifica= lly of > >multiple dpdk applications using a dpdk shared library) > > > >3) The removal of the eal_parse_args code from the core dpdk library e= ntirely, > >packaging it instead as its own library that interprets command line a= rguments > >as currently defined, and populates an instance of the structure defin= ed in (1) > > > >4) Altering the Makefiles, so that the example apps link against the n= ew library > >in (3), altering the app source code to work with the config structure= defined > >in (1) > > > >With those steps, I think we will remove the command line bits from th= e dpdk > >core, and do so without altering the user experience for any of the sa= mple apps > >(which will demonstrate to other developers that the same can be done = with their > >applications). From there we will be free to create alternate methods= of > >populating the config struct defined in (1) (via JSON file, YAML, XML,= or > >whatever). > > > >Neil > > > >> >>=20 > >> >> For the purposes of the example apps, it would seem that either J= SON, YAML, or > >> >> the above Lua format would work just fine. > >> > > >> >+1 > >> > > >>=20 > >> Regards, > >> ++Keith > >>=20 > >>=20 > > >=20 >=20 >=20