Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 236867
b: refs/heads/master
c: 119b3d3
h: refs/heads/master
i:
  236865: 93fc318
  236863: dc86abe
v: v3
  • Loading branch information
stephen hemminger authored and David S. Miller committed Feb 3, 2011
1 parent 39522a9 commit 7f98210
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b299e4f001cfa16205f9121f4630970049652268
refs/heads/master: 119b3d386985fcd477b3131190c041516a73f83a
9 changes: 5 additions & 4 deletions trunk/net/sched/sch_sfq.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,17 +491,18 @@ static int sfq_change(struct Qdisc *sch, struct nlattr *opt)
if (opt->nla_len < nla_attr_size(sizeof(*ctl)))
return -EINVAL;

if (ctl->divisor &&
(!is_power_of_2(ctl->divisor) || ctl->divisor > 65536))
return -EINVAL;

sch_tree_lock(sch);
q->quantum = ctl->quantum ? : psched_mtu(qdisc_dev(sch));
q->scaled_quantum = SFQ_ALLOT_SIZE(q->quantum);
q->perturb_period = ctl->perturb_period * HZ;
if (ctl->limit)
q->limit = min_t(u32, ctl->limit, SFQ_DEPTH - 1);
if (ctl->divisor) {
if (!is_power_of_2(ctl->divisor) || ctl->divisor > 65536)
return -EINVAL;
if (ctl->divisor)
q->divisor = ctl->divisor;
}
qlen = sch->q.qlen;
while (sch->q.qlen > q->limit)
sfq_drop(sch);
Expand Down

0 comments on commit 7f98210

Please sign in to comment.