[dpdk-dev] [PATCH 0/3] Add support for using a config file for DPDK

Jacek Piasecki jacekx.piasecki at intel.com
Tue May 30 10:30:34 CEST 2017


From: Michal Jastrzebski <michalx.k.jastrzebski at intel.com>

This patch introduce a mechanism for running dpdk application with parameters
provided by configuration file. New API for cfgfile library allows to create
a cfgfile at runtime, add new section and add entry in a section - opens up
the possibility to have applications dynamically build up a proper DPDK
configuration, rather than having to have a pre-existing one.

A new API for EAL takes a config file data type - either loaded from file,
or built up programmatically in the application - and extracts DPDK parameters
from it to be used when eal init is called. This allows apps to have an alternative
method to configure EAL, other than via command-line parameters.

Testpmd application is used to the demonstrate the new eal API.
If a --cfgfile-path <path> option is passed into command line non EAL section,
then the file is loaded and used by app. If a file called config.ini is present
in current working directory, and no --cfgfile-path option is passed in,
config.ini file will be loaded and used by app.

Currently *.ini file format is supported, but we would like to demonstrate in
v2 how alternative config file formats could be used. Other work planned for v2:
support for subsections – allowing to pass i.e. [DPDK.vdev0] and its parameters,
cleanup to EAL API and testpmd.

Jacek Piasecki (1):
  cfgfile: add new API functions

Kuba Kozak (2):
  eal: add functions parsing EAL arguments
  app/testpmd: changed example to parse options from cfg file

 app/test-pmd/config.ini                         |   16 ++
 app/test-pmd/parameters.c                       |  135 ++++++++++-
 app/test-pmd/testpmd.c                          |   51 +++-
 app/test-pmd/testpmd.h                          |    2 +-
 lib/Makefile                                    |    6 +-
 lib/librte_cfgfile/Makefile                     |    1 +
 lib/librte_cfgfile/rte_cfgfile.c                |  293 +++++++++++++----------
 lib/librte_cfgfile/rte_cfgfile.h                |   52 ++++
 lib/librte_cfgfile/rte_cfgfile_version.map      |    9 +
 lib/librte_eal/bsdapp/eal/Makefile              |    4 +
 lib/librte_eal/bsdapp/eal/eal.c                 |  128 +++++++++-
 lib/librte_eal/bsdapp/eal/rte_eal_version.map   |    5 +
 lib/librte_eal/common/include/rte_eal.h         |    6 +
 lib/librte_eal/linuxapp/eal/Makefile            |    3 +
 lib/librte_eal/linuxapp/eal/eal.c               |  108 ++++++++-
 lib/librte_eal/linuxapp/eal/rte_eal_version.map |    4 +
 mk/rte.app.mk                                   |    2 +-
 17 files changed, 684 insertions(+), 141 deletions(-)
 create mode 100644 app/test-pmd/config.ini

-- 
1.7.9.5



More information about the dev mailing list