From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.mhcomputing.net (master.mhcomputing.net [74.208.228.170]) by dpdk.org (Postfix) with ESMTP id 1C02247D0 for ; Fri, 3 Jun 2016 23:38:49 +0200 (CEST) Received: by mail.mhcomputing.net (Postfix, from userid 1000) id 3FE14D7; Fri, 3 Jun 2016 14:38:48 -0700 (PDT) Date: Fri, 3 Jun 2016 14:38:48 -0700 From: Matthew Hall To: Arnon Warshavsky Cc: Neil Horman , "Wiles, Keith" , Panu Matilainen , "Richardson, Bruce" , Thomas Monjalon , Yuanhan Liu , "dev@dpdk.org" , "Tan, Jianfeng" , Stephen Hemminger , Christian Ehrhardt , Olivier Matz Message-ID: <20160603213848.GA16022@mhcomputing.net> References: <20160603110129.GB17812@bricha3-MOBL3> <20160603115048.GA12627@hmsreliant.think-freely.org> <8CE01283-1E89-4302-BE7D-486975B43EF6@intel.com> <20160603174437.GC12627@hmsreliant.think-freely.org> <62A67FEB-AE18-43B1-8D15-27F23D5C8A7D@intel.com> <20160603183819.GD12627@hmsreliant.think-freely.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [dpdk-dev] [RFC] Yet another option for DPDK options X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jun 2016 21:38:49 -0000 On Fri, Jun 03, 2016 at 09:52:40PM +0300, Arnon Warshavsky wrote: > What about the data types of the values? > I would assume that as a library it can provide the service of typed > get/set and not leave conversion and validation to the app. > > rte_map_get_int(map,section,key) > rte_map_get_double(...) > rte_map_get_string(...) > rte_map_get_bytes(...,destBuff , destBuffSize) //e.g byte array of RSS key > > This may also allow some basic validity of the configuration file > > Another point I forgot about is default values. > We sometimes use a notation where the app also specifies a default value in > case the configuration did not specify it > rte_map_get_int(map,section,key , defaultValue ) > and specify if this was a mandatory that has no default > rte_map_get_int_crash_if_missing (map,section,key) This is why I was advising to use something similar to json-c's API with some type specific functions to make things easier for the users, with the dot-terminated naming made popular by sysctl such as "debug.intel.ctr_KMD_CTR_RPUPEI" and so forth. > /Arnon Matthew