On 6/1/16, 11:18 AM, "Richardson, Bruce" <bruce.richardson at intel.com> wrote:
>On Wed, Jun 01, 2016 at 10:58:41AM -0500, Jay Rolette wrote: >> On Wed, Jun 1, 2016 at 10:00 AM, Wiles, Keith <keith.wiles at intel.com> >> wrote: >> >> > Started from the link below, but did not want to highjack the thread. >> > http://dpdk.org/ml/archives/dev/2016-June/040021.html >> > >> > I was thinking about this problem from a user perspective and command line >> > options are very difficult to manage specifically when you have a large >> > number of options as we have in dpdk. I see all of these options as a type >> > of database of information for the DPDK and the application, because the >> > application command line options are also getting very complex as well. >> > >> > I have been looking at a number of different options here and the >> > direction I was thinking was using a file for the options and >> > configurations with the data in a clean format. It could have been a INI >> > file or JSON or XML, but they all seem to have some problems I do not like. >> > The INI file is too flat and I wanted a hierarchy in the data, the JSON >> > data is similar and XML is just hard to read. I wanted to be able to manage >> > multiple applications and possible system the DPDK/app runs. The problem >> > with the above formats is they are just data and not easy to make decisions >> > about the system and applications at runtime. >> > >> >> INI format is simplest for users to read, but if you really need hierarchy, >> JSON will do that just fine. Not sure what you mean by "JSON data is >> similar"... >> >> >I'd be quite concerned if we start needing lots of hierarchies for >configuration. > >I'd really just like to see ini file format used for this because: >* it's a well understood, simple format >* very easily human readable and editable >* lots of support for it in lots of languages >* hierarchies are possible in it too - just not as easy as in other formats > though. [In a previous life I worked with ini files which had address > hierarchies 6-levels deep in them. It wasn't hard to work with] Maybe INI will work for hierarchies, but I bet it was not super obvious without a lot of comments. >* it works well with grep since you must have one value per-line >* it allows comments We can have comments in any format not really a deciding factor IMHO. >* we already have a DPDK library for parsing them > >However, for me the biggest advantage of using something like ini is that it >would force us to keep things simple! Simple is good and with any of these formats you can be simple or complex, just depends on the usage. If all I wanted was to run a few examples then I would say INI is just fine. I would like to have a configuration file that can help me understand the system and pick the right options for a two socket system or one socket or system with 4 cores or 16 or running in a VM/container or not or FreeBSD or Linux or ? you get the picture all with a single image (maybe not with the FreeBSD/Linux). In a static data format you do not get these easily (maybe if you added a bunch of different options and then made the code figure out which ones to use), in a interpreted language you do get them for free. This is why I do not want just a database of options. > >I'd stay away from formats like json or XML that are designed for serializing >entire objects or structures, and look for something that allows us to just >specify configuration values. > >Regards, >/Bruce > >