diff options
author | David S. Miller <davem@davemloft.net> | 2013-12-18 16:42:06 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-12-18 16:42:06 -0500 |
commit | 143c9054949436cb05e468439dc5e46231f33d09 (patch) | |
tree | c2e972d8188fb1b36368e9acb5b6b59466c9d903 /net/sched/sch_htb.c | |
parent | 0b6807034791160d5e584138943d2daea765436d (diff) | |
parent | 35eecf052250f663f07a4cded7d3503fd1b50729 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
drivers/net/ethernet/intel/i40e/i40e_main.c
drivers/net/macvtap.c
Both minor merge hassles, simple overlapping changes.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_htb.c')
-rw-r--r-- | net/sched/sch_htb.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c index 830c64f25539..6b0e854b0115 100644 --- a/net/sched/sch_htb.c +++ b/net/sched/sch_htb.c | |||
@@ -1471,11 +1471,22 @@ static int htb_change_class(struct Qdisc *sch, u32 classid, | |||
1471 | sch_tree_lock(sch); | 1471 | sch_tree_lock(sch); |
1472 | } | 1472 | } |
1473 | 1473 | ||
1474 | rate64 = tb[TCA_HTB_RATE64] ? nla_get_u64(tb[TCA_HTB_RATE64]) : 0; | ||
1475 | |||
1476 | ceil64 = tb[TCA_HTB_CEIL64] ? nla_get_u64(tb[TCA_HTB_CEIL64]) : 0; | ||
1477 | |||
1478 | psched_ratecfg_precompute(&cl->rate, &hopt->rate, rate64); | ||
1479 | psched_ratecfg_precompute(&cl->ceil, &hopt->ceil, ceil64); | ||
1480 | |||
1474 | /* it used to be a nasty bug here, we have to check that node | 1481 | /* it used to be a nasty bug here, we have to check that node |
1475 | * is really leaf before changing cl->un.leaf ! | 1482 | * is really leaf before changing cl->un.leaf ! |
1476 | */ | 1483 | */ |
1477 | if (!cl->level) { | 1484 | if (!cl->level) { |
1478 | cl->quantum = hopt->rate.rate / q->rate2quantum; | 1485 | u64 quantum = cl->rate.rate_bytes_ps; |
1486 | |||
1487 | do_div(quantum, q->rate2quantum); | ||
1488 | cl->quantum = min_t(u64, quantum, INT_MAX); | ||
1489 | |||
1479 | if (!hopt->quantum && cl->quantum < 1000) { | 1490 | if (!hopt->quantum && cl->quantum < 1000) { |
1480 | pr_warning( | 1491 | pr_warning( |
1481 | "HTB: quantum of class %X is small. Consider r2q change.\n", | 1492 | "HTB: quantum of class %X is small. Consider r2q change.\n", |
@@ -1494,13 +1505,6 @@ static int htb_change_class(struct Qdisc *sch, u32 classid, | |||
1494 | cl->prio = TC_HTB_NUMPRIO - 1; | 1505 | cl->prio = TC_HTB_NUMPRIO - 1; |
1495 | } | 1506 | } |
1496 | 1507 | ||
1497 | rate64 = tb[TCA_HTB_RATE64] ? nla_get_u64(tb[TCA_HTB_RATE64]) : 0; | ||
1498 | |||
1499 | ceil64 = tb[TCA_HTB_CEIL64] ? nla_get_u64(tb[TCA_HTB_CEIL64]) : 0; | ||
1500 | |||
1501 | psched_ratecfg_precompute(&cl->rate, &hopt->rate, rate64); | ||
1502 | psched_ratecfg_precompute(&cl->ceil, &hopt->ceil, ceil64); | ||
1503 | |||
1504 | cl->buffer = PSCHED_TICKS2NS(hopt->buffer); | 1508 | cl->buffer = PSCHED_TICKS2NS(hopt->buffer); |
1505 | cl->cbuffer = PSCHED_TICKS2NS(hopt->cbuffer); | 1509 | cl->cbuffer = PSCHED_TICKS2NS(hopt->cbuffer); |
1506 | 1510 | ||