aboutsummaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorMatias Elo <matias.elo@nokia.com>2018-02-21 17:19:12 +0200
committerMaxim Uvarov <maxim.uvarov@linaro.org>2018-03-06 19:31:28 +0300
commit534667daec58ce8b2e417709e788934bea6f8f09 (patch)
tree2bb72f5d120817e516e97cdac56c00e2d9729e49 /config
parentf3cf9c3583364af7625679d0021c4d55c3414994 (diff)
linux-gen: add runtime configuration file
Enables changing ODP runtime configuration options by using an optional configuration file (libconfig). Path to the conf file is passed using environment variable ODP_CONF_FILE. If ODP_CONF_FILE or a particular option is not set, hardcoded default values are used instead. An template configuration file is provided in config/odp-linux.conf. Runtime configuration is initially used by DPDK pktio to set NIC options. Adds new dependency to libconfig library. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'config')
-rw-r--r--config/README10
-rw-r--r--config/odp-linux-generic.conf32
2 files changed, 42 insertions, 0 deletions
diff --git a/config/README b/config/README
index 3f4336103..9d6b87b41 100644
--- a/config/README
+++ b/config/README
@@ -1,2 +1,12 @@
ODP configuration options
-------------------------
+
+Runtime configuration options can be passed to an ODP instance by
+setting ODP_CONFIG_FILE environment variable to point to a libconfig
+format configuration file. A template configuration file with default
+values is provided in config/odp-linux-generic.conf. The values set in
+config/odp-linux-generic.conf are hardcoded during configure/build
+phase. If ODP_CONFIG_FILE is not set at runtime, hardcoded default
+values are used instead of any configuration file. A configuration file
+passed using ODP_CONFIG_FILE doesn't have to include all available
+options. The missing options are replaced with hardcoded default values.
diff --git a/config/odp-linux-generic.conf b/config/odp-linux-generic.conf
new file mode 100644
index 000000000..15e65d00f
--- /dev/null
+++ b/config/odp-linux-generic.conf
@@ -0,0 +1,32 @@
+# ODP runtime configuration options
+#
+# This template configuration file (odp-linux-generic.conf) is hardcoded
+# during configure/build phase and the values defined here are used if
+# optional ODP_CONFIG_FILE is not set. This configuration file MUST
+# include all configuration options.
+#
+# ODP_CONFIG_FILE can be used to override default values and it doesn't
+# have to include all available options. The missing options are
+# replaced with hardcoded default values.
+#
+# The options defined here are implementation specific and valid option
+# values should be checked from the implementation code.
+#
+# See libconfig syntax: https://hyperrealm.github.io/libconfig/libconfig_manual.html#Configuration-Files
+
+# Mandatory fields
+odp_implementation = "linux-generic"
+config_file_version = "0.0.1"
+
+# DPDK pktio options
+pktio_dpdk: {
+ # Default options
+ num_rx_desc = 128
+ num_tx_desc = 512
+ rx_drop_en = 0
+
+ # Driver specific options (use PMD names from DPDK)
+ net_ixgbe: {
+ rx_drop_en = 1
+ }
+}