From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 80D525A6A for ; Mon, 10 Jul 2017 14:50:38 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jul 2017 05:50:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,340,1496127600"; d="scan'208";a="1170693834" Received: from gklab-246-073.igk.intel.com (HELO Sent) ([10.217.246.73]) by fmsmga001.fm.intel.com with SMTP; 10 Jul 2017 05:50:34 -0700 Received: by Sent (sSMTP sendmail emulation); Mon, 10 Jul 2017 14:44:39 +0200 From: Jacek Piasecki To: dev@dpdk.org Cc: bruce.richardson@intel.com, deepak.k.jain@intel.com, kubax.kozak@intel.com, michalx.k.jastrzebski@intel.com, Jacek Piasecki Date: Mon, 10 Jul 2017 14:44:12 +0200 Message-Id: <1499690657-81150-1-git-send-email-jacekx.piasecki@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1498560760-104196-2-git-send-email-jacekx.piasecki@intel.com> References: <1498560760-104196-2-git-send-email-jacekx.piasecki@intel.com> Subject: [dpdk-dev] [PATCH v4 0/5] Rework cfgfile API to enable apps config file support 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: Mon, 10 Jul 2017 12:50:39 -0000 New API for cfgfile library allows to create a cfgfile at runtime, add new section, add entry in a section, update existing entry and save cfgfile structure to INI file - opens up the possibility to have applications dynamically build up a proper DPDK configuration, rather than having to have a pre-existing one. Due the new API functions, simplification of load() function was made. One new unit test to TEST app was added. It contains an example of a large INI file whose parsing requires multiple reallocation of memory. --- v4: Change members of structure cfgfile: - struct *sections[] to *sections - struct *entries[] to *entries - remove free_sections and free_entries Rework of existing cfgfile API functions to work with modified rte_cfgfile struct. Rework of malloc/realloc implementation due rte_cfgfile struct change, reducing mulitiple mallocs. Change return error codes for all library functions (errno.h) Checkpatch fixes v3: split one patchset into two distinct patchsets: 1. cfgfile library and TEST app changes 2. EAL changes and examples (this patchset depends on cfgfile) v2: lib eal: Rework of rte_eal_configure(struct rte_cfgfile *cfg, char *prgname). Now this function load data from cfg structure and did initial initialization of EAL arguments. Vdev argument are stored in different subsections eg. DPDK.vdev0, DPDK.vdev1 etc. After execution of this function it is necessary to call rte_eal_init to complete EAL initialization. There is no more merging arguments from different sources (cfg file and command line). Added non_eal_configure to testpmd application. Function maintain the same functionality as rte_eal_configure but for non-eal arguments. Added config JSON feature to testpmd last patch from patchset contain example showing use of .json configuration files. lib cfgfile: Rework of add_section(), add_entry() new implementation New members allocated_entries/sections, free_entries/sections in rte_cfgfile structure, change in array of pointers **sections, **entries instead of *sections[], *entries[] Add set_entry() to update/overwrite already existing entry in cfgfile struct Add save() function to save on disc cfgfile structure in INI format Rework of existing load() function simplifying the code Add unit test realloc_sections() in TEST app for testing realloc/malloc of new API functions, add test for save() function Jacek Piasecki (5): cfgfile: remove EAL dependency cfgfile: change existing API functions cfgfile: add new functions to API cfgfile: rework of load function test/cfgfile: add new unit test lib/Makefile | 3 +- lib/librte_cfgfile/Makefile | 1 + lib/librte_cfgfile/rte_cfgfile.c | 417 ++++++++++++++--------- lib/librte_cfgfile/rte_cfgfile.h | 82 ++++- lib/librte_cfgfile/rte_cfgfile_version.map | 11 + test/test/test_cfgfile.c | 40 +++ test/test/test_cfgfiles/etc/realloc_sections.ini | 128 +++++++ 7 files changed, 514 insertions(+), 168 deletions(-) create mode 100644 test/test/test_cfgfiles/etc/realloc_sections.ini -- 2.7.4