Commit Graph

11 Commits

Author SHA1 Message Date
Michal Kobylinski
907dd23866 cfgfile: fix uninitialized variable on load error
CID 13323:
Uninitialized scalar variable. Using uninitialized value
cfg->num_sections when calling rte_cfgfile_close.

Fixes: eaafbad419 ("cfgfile: library to interpret config files")

Signed-off-by: Michal Kobylinski <michalx.kobylinski@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2016-05-02 15:15:46 +02:00
Dmitriy Yakovlev
182d91f35b cfgfile: fix return value comment
Function rte_cfgfile_load can return NULL value, when something goes wrong.

Signed-off-by: Dmitriy Yakovlev <bombermag@gmail.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2016-05-02 15:15:45 +02:00
Rich Lane
c2189745c3 cfgfile: support looking up sections by index
This is useful when sections have duplicate names.

Signed-off-by: Rich Lane <rich.lane@bigswitch.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2016-02-29 11:28:31 +01:00
Huawei Xie
693f715da4 remove extra parentheses in return statement
fix the error reported by checkpatch:
  "ERROR: return is not a function, parentheses are not required"

remove parentheses in return like:
  "return (logical expressions)"

remove parentheses in return a function like:
  "return (rte_mempool_lookup(...))"

Fixes: 6307b909b8 ("lib: remove extra parenthesis after return")

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
2016-02-10 15:47:50 +01:00
Jasvinder Singh
ca743ea84e cfgfile: increase entry name and value sizes
This patch refers to the ABI change proposed for
librte_cfgfile(rte_cfgfile.h). In order to allow
for longer names and values, the values of macro
CFG_NAME_LEN and CFG_VAL_LEN is increased.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2015-10-22 18:35:11 +02:00
Daniel Mrzyglod
8646ea0116 cfgfile: fix unitialised buffer
Nature of the problem was not initialised buffer[256], there were probability
that operation system will provide previously used memory and on special condition
there were probability that string operations will work on random data that
could provide unexpected program behaviour.

Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2015-07-01 23:36:22 +02:00
Neil Horman
133b75923b mk: add library version extension
To differentiate libraries that break ABI, we add a library version number
suffix to the library, which must be incremented when a given libraries ABI is
broken.  This patch enforces that addition, sets the initial abi soname
extension to 1 for each library and creates a symlink to the base SONAME so that
the test applications will link properly.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
2015-02-03 16:56:58 +01:00
Neil Horman
9d41beed24 lib: provide initial versioning
Add linker version script files to each DPDK library to put a stake in the
ground from which we can start cleaning up API's

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
2015-02-03 16:56:58 +01:00
Bruce Richardson
d3e454a86f cfgfile: fix read of empty file
If the file to be read by the cfgfile is empty, i.e. no configuration
data, but possibly comments present, the cfgfile should not mark the
last processed section (curr_section) as having N entries, since there
is no last processed section.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2014-12-17 00:40:37 +01:00
Stephen Hemminger
6f41fe75e2 eal: deprecate rte_snprintf
The function rte_snprintf serves no useful purpose. It is the
same as snprintf() for all valid inputs. Deprecate it and
replace all uses in current code.

Leave the tests for the deprecated function in place.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2014-06-27 02:31:24 +02:00
Cristian Dumitrescu
eaafbad419 cfgfile: library to interpret config files
This library provides a tool to interpret config files that have
standard structure.

It is used by the Packet Framework examples/ip_pipeline sample application.

It originates from examples/qos_sched sample application and now it makes
this code available as a library for other sample applications to use.
The code duplication with qos_sched sample app to be addressed later.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Acked-by: Pablo de Lara Guarch <pablo.de.lara.guarch@intel.com>
Acked by: Ivan Boule <ivan.boule@6wind.com>
2014-06-17 03:34:11 +02:00