diff options
| -rw-r--r-- | include/uapi/linux/pkt_sched.h | 2 | ||||
| -rw-r--r-- | net/sched/sch_htb.c | 17 |
2 files changed, 17 insertions, 2 deletions
diff --git a/include/uapi/linux/pkt_sched.h b/include/uapi/linux/pkt_sched.h index 9b829134d422..f2624b549e61 100644 --- a/include/uapi/linux/pkt_sched.h +++ b/include/uapi/linux/pkt_sched.h | |||
| @@ -357,6 +357,8 @@ enum { | |||
| 357 | TCA_HTB_CTAB, | 357 | TCA_HTB_CTAB, |
| 358 | TCA_HTB_RTAB, | 358 | TCA_HTB_RTAB, |
| 359 | TCA_HTB_DIRECT_QLEN, | 359 | TCA_HTB_DIRECT_QLEN, |
| 360 | TCA_HTB_RATE64, | ||
| 361 | TCA_HTB_CEIL64, | ||
| 360 | __TCA_HTB_MAX, | 362 | __TCA_HTB_MAX, |
| 361 | }; | 363 | }; |
| 362 | 364 | ||
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c index 6b126f6c9957..0e1e38b40025 100644 --- a/net/sched/sch_htb.c +++ b/net/sched/sch_htb.c | |||
| @@ -997,6 +997,8 @@ static const struct nla_policy htb_policy[TCA_HTB_MAX + 1] = { | |||
| 997 | [TCA_HTB_CTAB] = { .type = NLA_BINARY, .len = TC_RTAB_SIZE }, | 997 | [TCA_HTB_CTAB] = { .type = NLA_BINARY, .len = TC_RTAB_SIZE }, |
| 998 | [TCA_HTB_RTAB] = { .type = NLA_BINARY, .len = TC_RTAB_SIZE }, | 998 | [TCA_HTB_RTAB] = { .type = NLA_BINARY, .len = TC_RTAB_SIZE }, |
| 999 | [TCA_HTB_DIRECT_QLEN] = { .type = NLA_U32 }, | 999 | [TCA_HTB_DIRECT_QLEN] = { .type = NLA_U32 }, |
| 1000 | [TCA_HTB_RATE64] = { .type = NLA_U64 }, | ||
| 1001 | [TCA_HTB_CEIL64] = { .type = NLA_U64 }, | ||
| 1000 | }; | 1002 | }; |
| 1001 | 1003 | ||
| 1002 | static void htb_work_func(struct work_struct *work) | 1004 | static void htb_work_func(struct work_struct *work) |
| @@ -1114,6 +1116,12 @@ static int htb_dump_class(struct Qdisc *sch, unsigned long arg, | |||
| 1114 | opt.level = cl->level; | 1116 | opt.level = cl->level; |
| 1115 | if (nla_put(skb, TCA_HTB_PARMS, sizeof(opt), &opt)) | 1117 | if (nla_put(skb, TCA_HTB_PARMS, sizeof(opt), &opt)) |
| 1116 | goto nla_put_failure; | 1118 | goto nla_put_failure; |
| 1119 | if ((cl->rate.rate_bytes_ps >= (1ULL << 32)) && | ||
| 1120 | nla_put_u64(skb, TCA_HTB_RATE64, cl->rate.rate_bytes_ps)) | ||
| 1121 | goto nla_put_failure; | ||
| 1122 | if ((cl->ceil.rate_bytes_ps >= (1ULL << 32)) && | ||
| 1123 | nla_put_u64(skb, TCA_HTB_CEIL64, cl->ceil.rate_bytes_ps)) | ||
| 1124 | goto nla_put_failure; | ||
| 1117 | 1125 | ||
| 1118 | nla_nest_end(skb, nest); | 1126 | nla_nest_end(skb, nest); |
| 1119 | spin_unlock_bh(root_lock); | 1127 | spin_unlock_bh(root_lock); |
| @@ -1332,6 +1340,7 @@ static int htb_change_class(struct Qdisc *sch, u32 classid, | |||
| 1332 | struct qdisc_rate_table *rtab = NULL, *ctab = NULL; | 1340 | struct qdisc_rate_table *rtab = NULL, *ctab = NULL; |
| 1333 | struct nlattr *tb[TCA_HTB_MAX + 1]; | 1341 | struct nlattr *tb[TCA_HTB_MAX + 1]; |
| 1334 | struct tc_htb_opt *hopt; | 1342 | struct tc_htb_opt *hopt; |
| 1343 | u64 rate64, ceil64; | ||
| 1335 | 1344 | ||
| 1336 | /* extract all subattrs from opt attr */ | 1345 | /* extract all subattrs from opt attr */ |
| 1337 | if (!opt) | 1346 | if (!opt) |
| @@ -1491,8 +1500,12 @@ static int htb_change_class(struct Qdisc *sch, u32 classid, | |||
| 1491 | cl->prio = TC_HTB_NUMPRIO - 1; | 1500 | cl->prio = TC_HTB_NUMPRIO - 1; |
| 1492 | } | 1501 | } |
| 1493 | 1502 | ||
| 1494 | psched_ratecfg_precompute(&cl->rate, &hopt->rate, 0); | 1503 | rate64 = tb[TCA_HTB_RATE64] ? nla_get_u64(tb[TCA_HTB_RATE64]) : 0; |
| 1495 | psched_ratecfg_precompute(&cl->ceil, &hopt->ceil, 0); | 1504 | |
| 1505 | ceil64 = tb[TCA_HTB_CEIL64] ? nla_get_u64(tb[TCA_HTB_CEIL64]) : 0; | ||
| 1506 | |||
| 1507 | psched_ratecfg_precompute(&cl->rate, &hopt->rate, rate64); | ||
| 1508 | psched_ratecfg_precompute(&cl->ceil, &hopt->ceil, ceil64); | ||
| 1496 | 1509 | ||
| 1497 | cl->buffer = PSCHED_TICKS2NS(hopt->buffer); | 1510 | cl->buffer = PSCHED_TICKS2NS(hopt->buffer); |
| 1498 | cl->cbuffer = PSCHED_TICKS2NS(hopt->cbuffer); | 1511 | cl->cbuffer = PSCHED_TICKS2NS(hopt->cbuffer); |
