summaryrefslogtreecommitdiff
path: root/accel-pppd/shaper/shaper.c
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2014-11-10 14:14:26 +0300
committerDmitry Kozlov <xeb@mail.ru>2014-11-10 14:16:47 +0300
commitca0d0010a85300b6959d7b6ccba52ab101915c0b (patch)
tree7f24aed9ed95ce7ae98b54fa65fd82f5c71caf69 /accel-pppd/shaper/shaper.c
parentb276238f8721849c364cf718f854c7b07a706254 (diff)
downloadaccel-ppp-ca0d0010a85300b6959d7b6ccba52ab101915c0b.tar.gz
accel-ppp-ca0d0010a85300b6959d7b6ccba52ab101915c0b.zip
shaper: fixed passing quantum parameter to kernel
shaper: introduced moderate-quantum option If fixed quantum is not specified and moderate-quantum is specified then shaper module will check for quantum value to be in valid range (1000-200000). This suppresses annoying kernel messages. Remark: quantum is rate/r2q, rate is in bytes/sec.
Diffstat (limited to 'accel-pppd/shaper/shaper.c')
-rw-r--r--accel-pppd/shaper/shaper.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/accel-pppd/shaper/shaper.c b/accel-pppd/shaper/shaper.c
index 40677de8..14388eda 100644
--- a/accel-pppd/shaper/shaper.c
+++ b/accel-pppd/shaper/shaper.c
@@ -38,6 +38,7 @@ double conf_latency = 0.05;
int conf_mpu = 0;
int conf_mtu = 0;
int conf_quantum = 1500;
+int conf_moderate_quantum;
int conf_r2q = 10;
int conf_cburst = 1534;
int conf_ifb_ifindex;
@@ -909,12 +910,22 @@ static void load_config(void)
conf_mtu = 0;
opt = conf_get_opt("shaper", "r2q");
- if (opt && atoi(opt) >= 0)
+ if (opt)
conf_r2q = atoi(opt);
+ else
+ conf_r2q = 10;
opt = conf_get_opt("shaper", "quantum");
- if (opt && atoi(opt) >= 0)
+ if (opt)
conf_quantum = atoi(opt);
+ else
+ conf_quantum = 0;
+
+ opt = conf_get_opt("shaper", "moderate-quantum");
+ if (opt)
+ conf_moderate_quantum = atoi(opt);
+ else
+ conf_moderate_quantum = 0;
opt = conf_get_opt("shaper", "cburst");
if (opt && atoi(opt) >= 0)