diff options
-rw-r--r-- | net/sched/sch_htb.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c index 162fb800754c..1a3655a606c1 100644 --- a/net/sched/sch_htb.c +++ b/net/sched/sch_htb.c | |||
@@ -65,6 +65,10 @@ static int htb_hysteresis __read_mostly = 0; /* whether to use mode hysteresis f | |||
65 | module_param (htb_hysteresis, int, 0640); | 65 | module_param (htb_hysteresis, int, 0640); |
66 | MODULE_PARM_DESC(htb_hysteresis, "Hysteresis mode, less CPU load, less accurate"); | 66 | MODULE_PARM_DESC(htb_hysteresis, "Hysteresis mode, less CPU load, less accurate"); |
67 | 67 | ||
68 | static int htb_rate_est = 0; /* htb classes have a default rate estimator */ | ||
69 | module_param(htb_rate_est, int, 0640); | ||
70 | MODULE_PARM_DESC(htb_rate_est, "setup a default rate estimator (4sec 16sec) for htb classes"); | ||
71 | |||
68 | /* used internaly to keep status of single class */ | 72 | /* used internaly to keep status of single class */ |
69 | enum htb_cmode { | 73 | enum htb_cmode { |
70 | HTB_CANT_SEND, /* class can't send and can't borrow */ | 74 | HTB_CANT_SEND, /* class can't send and can't borrow */ |
@@ -1366,12 +1370,14 @@ static int htb_change_class(struct Qdisc *sch, u32 classid, | |||
1366 | if (!cl) | 1370 | if (!cl) |
1367 | goto failure; | 1371 | goto failure; |
1368 | 1372 | ||
1369 | err = gen_new_estimator(&cl->bstats, &cl->rate_est, | 1373 | if (htb_rate_est || tca[TCA_RATE]) { |
1370 | qdisc_root_sleeping_lock(sch), | 1374 | err = gen_new_estimator(&cl->bstats, &cl->rate_est, |
1371 | tca[TCA_RATE] ? : &est.nla); | 1375 | qdisc_root_sleeping_lock(sch), |
1372 | if (err) { | 1376 | tca[TCA_RATE] ? : &est.nla); |
1373 | kfree(cl); | 1377 | if (err) { |
1374 | goto failure; | 1378 | kfree(cl); |
1379 | goto failure; | ||
1380 | } | ||
1375 | } | 1381 | } |
1376 | 1382 | ||
1377 | cl->refcnt = 1; | 1383 | cl->refcnt = 1; |