Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 361044
b: refs/heads/master
c: 9b99b7e
h: refs/heads/master
v: v3
  • Loading branch information
Paolo Valente authored and David S. Miller committed Mar 6, 2013
1 parent 629cb7a commit 6b4f654
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 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: f74861ca87264e594e0134e8ac14db06be77fe6f
refs/heads/master: 9b99b7e90bf5cd9a88823c49574ba80d92a98262
13 changes: 11 additions & 2 deletions trunk/net/sched/sch_qfq.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,10 @@ static void qfq_update_agg(struct qfq_sched *q, struct qfq_aggregate *agg,
new_num_classes == q->max_agg_classes - 1) /* agg no more full */
hlist_add_head(&agg->nonfull_next, &q->nonfull_aggs);

/* The next assignment may let
* agg->initial_budget > agg->budgetmax
* hold, we will take it into account in charge_actual_service().
*/
agg->budgetmax = new_num_classes * agg->lmax;
new_agg_weight = agg->class_weight * new_num_classes;
agg->inv_w = ONE_FP/new_agg_weight;
Expand Down Expand Up @@ -988,8 +992,13 @@ static inline struct sk_buff *qfq_peek_skb(struct qfq_aggregate *agg,
/* Update F according to the actual service received by the aggregate. */
static inline void charge_actual_service(struct qfq_aggregate *agg)
{
/* compute the service received by the aggregate */
u32 service_received = agg->initial_budget - agg->budget;
/* Compute the service received by the aggregate, taking into
* account that, after decreasing the number of classes in
* agg, it may happen that
* agg->initial_budget - agg->budget > agg->bugdetmax
*/
u32 service_received = min(agg->budgetmax,
agg->initial_budget - agg->budget);

agg->F = agg->S + (u64)service_received * agg->inv_w;
}
Expand Down

0 comments on commit 6b4f654

Please sign in to comment.