summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKozlov Dmitry <xeb@mail.ru>2012-02-28 13:25:37 +0400
committerKozlov Dmitry <xeb@mail.ru>2012-02-28 13:47:57 +0400
commitcf40442a413d04379711bd73a52372d3a3264ea4 (patch)
tree2695fa77df3478ceb6a5feea7c04ce86e7959a71
parent0144238b8e364dac353797368fe45cda5426d88d (diff)
downloadaccel-ppp-cf40442a413d04379711bd73a52372d3a3264ea4.tar.gz
accel-ppp-cf40442a413d04379711bd73a52372d3a3264ea4.zip
shaper: add cburst configuration option
-rw-r--r--accel-pppd/accel-ppp.conf1
-rw-r--r--accel-pppd/shaper/limiter.c2
-rw-r--r--accel-pppd/shaper/shaper.c8
-rw-r--r--accel-pppd/shaper/shaper.h1
4 files changed, 11 insertions, 1 deletions
diff --git a/accel-pppd/accel-ppp.conf b/accel-pppd/accel-ppp.conf
index c59b205..86741f5 100644
--- a/accel-pppd/accel-ppp.conf
+++ b/accel-pppd/accel-ppp.conf
@@ -151,6 +151,7 @@ gw-ip-address=192.168.100.1
#mpu=0
#r2q=10
#quantum=1500
+#cburst=1534
#ifb=ifb0
up-limiter=police
down-limiter=tbf
diff --git a/accel-pppd/shaper/limiter.c b/accel-pppd/shaper/limiter.c
index ab0e67a..6becb39 100644
--- a/accel-pppd/shaper/limiter.c
+++ b/accel-pppd/shaper/limiter.c
@@ -110,7 +110,7 @@ static int qdisc_htb_class(struct qdisc_opt *qopt, struct nlmsghdr *n)
log_ppp_error("shaper: failed to calculate ceil rate table.\n");
return -1;
}
- opt.cbuffer = tc_calc_xmittime(opt.ceil.rate, qopt->buffer);
+ opt.cbuffer = tc_calc_xmittime(opt.ceil.rate, conf_cburst);
tail = NLMSG_TAIL(n);
addattr_l(n, 1024, TCA_OPTIONS, NULL, 0);
diff --git a/accel-pppd/shaper/shaper.c b/accel-pppd/shaper/shaper.c
index 1363b98..bcf705c 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_quantum = 1500;
int conf_r2q = 10;
+int conf_cburst = 1534;
int conf_ifb_ifindex;
int conf_up_limiter = LIM_POLICE;
@@ -550,6 +551,9 @@ static int shaper_restore_exec(const char *cmd, char * const *f, int f_cnt, void
{
struct shaper_pd_t *pd;
int all, found = 0;;
+ int *ptr = 0;
+
+ *ptr = 1;
if (f_cnt != 3)
return CLI_CMD_SYNTAX;
@@ -861,6 +865,10 @@ static void load_config(void)
opt = conf_get_opt("shaper", "quantum");
if (opt && atoi(opt) >= 0)
conf_quantum = atoi(opt);
+
+ opt = conf_get_opt("shaper", "cburst");
+ if (opt && atoi(opt) >= 0)
+ conf_cburst = atoi(opt);
opt = conf_get_opt("shaper", "up-limiter");
if (opt) {
diff --git a/accel-pppd/shaper/shaper.h b/accel-pppd/shaper/shaper.h
index 2b0514b..bd2a718 100644
--- a/accel-pppd/shaper/shaper.h
+++ b/accel-pppd/shaper/shaper.h
@@ -14,6 +14,7 @@ extern double conf_latency;
extern int conf_mpu;
extern int conf_quantum;
extern int conf_r2q;
+extern int conf_cburst;
extern int conf_ifb_ifindex;
int install_limiter(struct ppp_t *ppp, int down_speed, int down_burst, int up_speed, int up_burst);