This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "".
The branch, master has been updated via 57df98eca15fe64a716f9f555714ef5fb9cd25e9 (commit) from 674ea087fba016e55f03e3966fe64fc908141f8f (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit 57df98eca15fe64a716f9f555714ef5fb9cd25e9 Author: Bogdan Pricope bogdan.pricope@linaro.org Date: Thu Mar 29 11:47:02 2018 +0300
linux-gen: dpdk: fix runtime/default config read order
Signed-off-by: Bogdan Pricope bogdan.pricope@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/include/odp_libconfig_internal.h b/platform/linux-generic/include/odp_libconfig_internal.h index 04291775..727f6886 100644 --- a/platform/linux-generic/include/odp_libconfig_internal.h +++ b/platform/linux-generic/include/odp_libconfig_internal.h @@ -22,6 +22,11 @@ int _odp_libconfig_term_global(void);
int _odp_libconfig_lookup_int(const char *path, int *value);
+int _odp_libconfig_lookup_ext_int(const char *base_path, + const char *local_path, + const char *name, + int *value); + #ifdef __cplusplus } #endif diff --git a/platform/linux-generic/odp_libconfig.c b/platform/linux-generic/odp_libconfig.c index 85acc572..316ed067 100644 --- a/platform/linux-generic/odp_libconfig.c +++ b/platform/linux-generic/odp_libconfig.c @@ -95,3 +95,41 @@ int _odp_libconfig_lookup_int(const char *path, int *value)
return (ret_def == CONFIG_TRUE || ret_rt == CONFIG_TRUE) ? 1 : 0; } + +static int lookup_int(config_t *cfg, + const char *base_path, + const char *local_path, + const char *name, + int *value) +{ + char path[256]; + + if (local_path) { + snprintf(path, sizeof(path), "%s.%s.%s", base_path, + local_path, name); + if (config_lookup_int(cfg, path, value) == CONFIG_TRUE) + return 1; + } + + snprintf(path, sizeof(path), "%s.%s", base_path, name); + if (config_lookup_int(cfg, path, value) == CONFIG_TRUE) + return 1; + + return 0; +} + +int _odp_libconfig_lookup_ext_int(const char *base_path, + const char *local_path, + const char *name, + int *value) +{ + if (lookup_int(&odp_global_data.libconfig_runtime, + base_path, local_path, name, value)) + return 1; + + if (lookup_int(&odp_global_data.libconfig_default, + base_path, local_path, name, value)) + return 1; + + return 0; +} diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c index d40ad954..7bccab87 100644 --- a/platform/linux-generic/pktio/dpdk.c +++ b/platform/linux-generic/pktio/dpdk.c @@ -95,22 +95,16 @@ void refer_constructors(void) } #endif
-static int lookup_opt(const char *path, const char *drv_name, int *val) +static int lookup_opt(const char *opt_name, const char *drv_name, int *val) { const char *base = "pktio_dpdk"; - char opt_path[256]; - int ret = 0; - - /* Default option */ - snprintf(opt_path, sizeof(opt_path), "%s.%s", base, path); - ret += _odp_libconfig_lookup_int(opt_path, val); - - /* Driver specific option overrides default option */ - snprintf(opt_path, sizeof(opt_path), "%s.%s.%s", base, drv_name, path); - ret += _odp_libconfig_lookup_int(opt_path, val); + int ret;
+ ret = _odp_libconfig_lookup_ext_int(base, drv_name, opt_name, val); if (ret == 0) - ODP_ERR("Unable to find DPDK configuration option: %s\n", path); + ODP_ERR("Unable to find DPDK configuration option: %s\n", + opt_name); + return ret; }
-----------------------------------------------------------------------
Summary of changes: .../linux-generic/include/odp_libconfig_internal.h | 5 +++ platform/linux-generic/odp_libconfig.c | 38 ++++++++++++++++++++++ platform/linux-generic/pktio/dpdk.c | 18 ++++------ 3 files changed, 49 insertions(+), 12 deletions(-)
hooks/post-receive