summaryrefslogtreecommitdiffhomepage
path: root/config.c
diff options
context:
space:
mode:
authorJohn Crispin <john@phrozen.org>2017-08-22 09:10:58 +0200
committerJohn Crispin <john@phrozen.org>2017-08-22 09:10:58 +0200
commitb5731bfbabaf7aab0fc47143bd6ad0b12cc3df0a (patch)
tree747743efa83dc28a6b3b73bda992ad970786af48 /config.c
parent2a29d1a8d45f164e9a3fda31264bf70b8f90d9ad (diff)
allow setting rps/xps defualt values via uci
Signed-off-by: John Crispin <john@phrozen.org>
Diffstat (limited to 'config.c')
-rw-r--r--config.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/config.c b/config.c
index 2454e9b..a7112f0 100644
--- a/config.c
+++ b/config.c
@@ -289,6 +289,18 @@ config_init_rules(void)
iprule_update_complete();
}
+static int
+config_parse_global_ps_val(struct uci_section *globals, const char *option)
+{
+ const char *val = uci_lookup_option_string(
+ uci_ctx, globals, option);
+ int ret = 0;
+
+ if (val)
+ ret = strtol(val, 0, 10);
+
+ return ret;
+}
static void
config_init_globals(void)
@@ -306,7 +318,10 @@ config_init_globals(void)
uci_ctx, globals, "default_ps");
if (default_ps)
- device_set_default_ps(strcmp(default_ps, "1") ? false : true);
+ device_set_default_ps(strcmp(default_ps, "1") ? false : true,
+ config_parse_global_ps_val(globals, "default_xps_val"),
+ config_parse_global_ps_val(globals, "default_rps_val"),
+ config_parse_global_ps_val(globals, "default_rps_flow_cnt"));
}
static void