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