diff options
author | David S. Miller <davem@davemloft.net> | 2011-01-24 17:09:35 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-01-24 17:09:35 -0500 |
commit | 5bdc22a56549e7983c6b443298672641952ea035 (patch) | |
tree | fbfd4e7453e4fd23dfef826d4610ed2aae47b36c /net/sched | |
parent | b6f4098897f30b7ea90a1c1edf35e9b20a9d828a (diff) | |
parent | e92427b289d252cfbd4cb5282d92f4ce1a5bb1fb (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
net/sched/sch_hfsc.c
net/sched/sch_htb.c
net/sched/sch_tbf.c
Diffstat (limited to 'net/sched')
-rw-r--r-- | net/sched/sch_cbq.c | 3 | ||||
-rw-r--r-- | net/sched/sch_drr.c | 2 | ||||
-rw-r--r-- | net/sched/sch_dsmark.c | 2 | ||||
-rw-r--r-- | net/sched/sch_fifo.c | 5 | ||||
-rw-r--r-- | net/sched/sch_hfsc.c | 2 | ||||
-rw-r--r-- | net/sched/sch_htb.c | 12 | ||||
-rw-r--r-- | net/sched/sch_multiq.c | 2 | ||||
-rw-r--r-- | net/sched/sch_netem.c | 3 | ||||
-rw-r--r-- | net/sched/sch_prio.c | 2 | ||||
-rw-r--r-- | net/sched/sch_red.c | 11 | ||||
-rw-r--r-- | net/sched/sch_sfq.c | 5 | ||||
-rw-r--r-- | net/sched/sch_tbf.c | 2 | ||||
-rw-r--r-- | net/sched/sch_teql.c | 3 |
13 files changed, 24 insertions, 30 deletions
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c index 25ed522b2891..24d94c097b35 100644 --- a/net/sched/sch_cbq.c +++ b/net/sched/sch_cbq.c | |||
@@ -391,7 +391,6 @@ cbq_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
391 | ret = qdisc_enqueue(skb, cl->q); | 391 | ret = qdisc_enqueue(skb, cl->q); |
392 | if (ret == NET_XMIT_SUCCESS) { | 392 | if (ret == NET_XMIT_SUCCESS) { |
393 | sch->q.qlen++; | 393 | sch->q.qlen++; |
394 | qdisc_bstats_update(sch, skb); | ||
395 | cbq_mark_toplevel(q, cl); | 394 | cbq_mark_toplevel(q, cl); |
396 | if (!cl->next_alive) | 395 | if (!cl->next_alive) |
397 | cbq_activate_class(cl); | 396 | cbq_activate_class(cl); |
@@ -650,7 +649,6 @@ static int cbq_reshape_fail(struct sk_buff *skb, struct Qdisc *child) | |||
650 | ret = qdisc_enqueue(skb, cl->q); | 649 | ret = qdisc_enqueue(skb, cl->q); |
651 | if (ret == NET_XMIT_SUCCESS) { | 650 | if (ret == NET_XMIT_SUCCESS) { |
652 | sch->q.qlen++; | 651 | sch->q.qlen++; |
653 | qdisc_bstats_update(sch, skb); | ||
654 | if (!cl->next_alive) | 652 | if (!cl->next_alive) |
655 | cbq_activate_class(cl); | 653 | cbq_activate_class(cl); |
656 | return 0; | 654 | return 0; |
@@ -973,6 +971,7 @@ cbq_dequeue(struct Qdisc *sch) | |||
973 | 971 | ||
974 | skb = cbq_dequeue_1(sch); | 972 | skb = cbq_dequeue_1(sch); |
975 | if (skb) { | 973 | if (skb) { |
974 | qdisc_bstats_update(sch, skb); | ||
976 | sch->q.qlen--; | 975 | sch->q.qlen--; |
977 | qdisc_unthrottled(sch); | 976 | qdisc_unthrottled(sch); |
978 | return skb; | 977 | return skb; |
diff --git a/net/sched/sch_drr.c b/net/sched/sch_drr.c index de55e642eafc..6b7fe4a84f13 100644 --- a/net/sched/sch_drr.c +++ b/net/sched/sch_drr.c | |||
@@ -376,7 +376,6 @@ static int drr_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
376 | } | 376 | } |
377 | 377 | ||
378 | bstats_update(&cl->bstats, skb); | 378 | bstats_update(&cl->bstats, skb); |
379 | qdisc_bstats_update(sch, skb); | ||
380 | 379 | ||
381 | sch->q.qlen++; | 380 | sch->q.qlen++; |
382 | return err; | 381 | return err; |
@@ -403,6 +402,7 @@ static struct sk_buff *drr_dequeue(struct Qdisc *sch) | |||
403 | skb = qdisc_dequeue_peeked(cl->qdisc); | 402 | skb = qdisc_dequeue_peeked(cl->qdisc); |
404 | if (cl->qdisc->q.qlen == 0) | 403 | if (cl->qdisc->q.qlen == 0) |
405 | list_del(&cl->alist); | 404 | list_del(&cl->alist); |
405 | qdisc_bstats_update(sch, skb); | ||
406 | sch->q.qlen--; | 406 | sch->q.qlen--; |
407 | return skb; | 407 | return skb; |
408 | } | 408 | } |
diff --git a/net/sched/sch_dsmark.c b/net/sched/sch_dsmark.c index 4970d56b4aa7..2c790204d042 100644 --- a/net/sched/sch_dsmark.c +++ b/net/sched/sch_dsmark.c | |||
@@ -260,7 +260,6 @@ static int dsmark_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
260 | return err; | 260 | return err; |
261 | } | 261 | } |
262 | 262 | ||
263 | qdisc_bstats_update(sch, skb); | ||
264 | sch->q.qlen++; | 263 | sch->q.qlen++; |
265 | 264 | ||
266 | return NET_XMIT_SUCCESS; | 265 | return NET_XMIT_SUCCESS; |
@@ -283,6 +282,7 @@ static struct sk_buff *dsmark_dequeue(struct Qdisc *sch) | |||
283 | if (skb == NULL) | 282 | if (skb == NULL) |
284 | return NULL; | 283 | return NULL; |
285 | 284 | ||
285 | qdisc_bstats_update(sch, skb); | ||
286 | sch->q.qlen--; | 286 | sch->q.qlen--; |
287 | 287 | ||
288 | index = skb->tc_index & (p->indices - 1); | 288 | index = skb->tc_index & (p->indices - 1); |
diff --git a/net/sched/sch_fifo.c b/net/sched/sch_fifo.c index f7290d2542c2..be33f9ddf9dd 100644 --- a/net/sched/sch_fifo.c +++ b/net/sched/sch_fifo.c | |||
@@ -45,17 +45,14 @@ static int pfifo_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
45 | 45 | ||
46 | static int pfifo_tail_enqueue(struct sk_buff *skb, struct Qdisc *sch) | 46 | static int pfifo_tail_enqueue(struct sk_buff *skb, struct Qdisc *sch) |
47 | { | 47 | { |
48 | struct sk_buff *skb_head; | ||
49 | struct fifo_sched_data *q = qdisc_priv(sch); | 48 | struct fifo_sched_data *q = qdisc_priv(sch); |
50 | 49 | ||
51 | if (likely(skb_queue_len(&sch->q) < q->limit)) | 50 | if (likely(skb_queue_len(&sch->q) < q->limit)) |
52 | return qdisc_enqueue_tail(skb, sch); | 51 | return qdisc_enqueue_tail(skb, sch); |
53 | 52 | ||
54 | /* queue full, remove one skb to fulfill the limit */ | 53 | /* queue full, remove one skb to fulfill the limit */ |
55 | skb_head = qdisc_dequeue_head(sch); | 54 | __qdisc_queue_drop_head(sch, &sch->q); |
56 | sch->qstats.drops++; | 55 | sch->qstats.drops++; |
57 | kfree_skb(skb_head); | ||
58 | |||
59 | qdisc_enqueue_tail(skb, sch); | 56 | qdisc_enqueue_tail(skb, sch); |
60 | 57 | ||
61 | return NET_XMIT_CN; | 58 | return NET_XMIT_CN; |
diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c index b632d9251913..6488e6425652 100644 --- a/net/sched/sch_hfsc.c +++ b/net/sched/sch_hfsc.c | |||
@@ -1598,7 +1598,6 @@ hfsc_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
1598 | set_active(cl, qdisc_pkt_len(skb)); | 1598 | set_active(cl, qdisc_pkt_len(skb)); |
1599 | 1599 | ||
1600 | bstats_update(&cl->bstats, skb); | 1600 | bstats_update(&cl->bstats, skb); |
1601 | qdisc_bstats_update(sch, skb); | ||
1602 | sch->q.qlen++; | 1601 | sch->q.qlen++; |
1603 | 1602 | ||
1604 | return NET_XMIT_SUCCESS; | 1603 | return NET_XMIT_SUCCESS; |
@@ -1665,6 +1664,7 @@ hfsc_dequeue(struct Qdisc *sch) | |||
1665 | } | 1664 | } |
1666 | 1665 | ||
1667 | qdisc_unthrottled(sch); | 1666 | qdisc_unthrottled(sch); |
1667 | qdisc_bstats_update(sch, skb); | ||
1668 | sch->q.qlen--; | 1668 | sch->q.qlen--; |
1669 | 1669 | ||
1670 | return skb; | 1670 | return skb; |
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c index 39db75cd8c17..e1429a85091f 100644 --- a/net/sched/sch_htb.c +++ b/net/sched/sch_htb.c | |||
@@ -581,7 +581,6 @@ static int htb_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
581 | } | 581 | } |
582 | 582 | ||
583 | sch->q.qlen++; | 583 | sch->q.qlen++; |
584 | qdisc_bstats_update(sch, skb); | ||
585 | return NET_XMIT_SUCCESS; | 584 | return NET_XMIT_SUCCESS; |
586 | } | 585 | } |
587 | 586 | ||
@@ -856,7 +855,7 @@ next: | |||
856 | 855 | ||
857 | static struct sk_buff *htb_dequeue(struct Qdisc *sch) | 856 | static struct sk_buff *htb_dequeue(struct Qdisc *sch) |
858 | { | 857 | { |
859 | struct sk_buff *skb = NULL; | 858 | struct sk_buff *skb; |
860 | struct htb_sched *q = qdisc_priv(sch); | 859 | struct htb_sched *q = qdisc_priv(sch); |
861 | int level; | 860 | int level; |
862 | psched_time_t next_event; | 861 | psched_time_t next_event; |
@@ -865,6 +864,8 @@ static struct sk_buff *htb_dequeue(struct Qdisc *sch) | |||
865 | /* try to dequeue direct packets as high prio (!) to minimize cpu work */ | 864 | /* try to dequeue direct packets as high prio (!) to minimize cpu work */ |
866 | skb = __skb_dequeue(&q->direct_queue); | 865 | skb = __skb_dequeue(&q->direct_queue); |
867 | if (skb != NULL) { | 866 | if (skb != NULL) { |
867 | ok: | ||
868 | qdisc_bstats_update(sch, skb); | ||
868 | qdisc_unthrottled(sch); | 869 | qdisc_unthrottled(sch); |
869 | sch->q.qlen--; | 870 | sch->q.qlen--; |
870 | return skb; | 871 | return skb; |
@@ -899,11 +900,8 @@ static struct sk_buff *htb_dequeue(struct Qdisc *sch) | |||
899 | 900 | ||
900 | m |= 1 << prio; | 901 | m |= 1 << prio; |
901 | skb = htb_dequeue_tree(q, prio, level); | 902 | skb = htb_dequeue_tree(q, prio, level); |
902 | if (likely(skb != NULL)) { | 903 | if (likely(skb != NULL)) |
903 | sch->q.qlen--; | 904 | goto ok; |
904 | qdisc_unthrottled(sch); | ||
905 | goto fin; | ||
906 | } | ||
907 | } | 905 | } |
908 | } | 906 | } |
909 | sch->qstats.overlimits++; | 907 | sch->qstats.overlimits++; |
diff --git a/net/sched/sch_multiq.c b/net/sched/sch_multiq.c index 820f2a7ca14d..edc1950e0e77 100644 --- a/net/sched/sch_multiq.c +++ b/net/sched/sch_multiq.c | |||
@@ -83,7 +83,6 @@ multiq_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
83 | 83 | ||
84 | ret = qdisc_enqueue(skb, qdisc); | 84 | ret = qdisc_enqueue(skb, qdisc); |
85 | if (ret == NET_XMIT_SUCCESS) { | 85 | if (ret == NET_XMIT_SUCCESS) { |
86 | qdisc_bstats_update(sch, skb); | ||
87 | sch->q.qlen++; | 86 | sch->q.qlen++; |
88 | return NET_XMIT_SUCCESS; | 87 | return NET_XMIT_SUCCESS; |
89 | } | 88 | } |
@@ -112,6 +111,7 @@ static struct sk_buff *multiq_dequeue(struct Qdisc *sch) | |||
112 | qdisc = q->queues[q->curband]; | 111 | qdisc = q->queues[q->curband]; |
113 | skb = qdisc->dequeue(qdisc); | 112 | skb = qdisc->dequeue(qdisc); |
114 | if (skb) { | 113 | if (skb) { |
114 | qdisc_bstats_update(sch, skb); | ||
115 | sch->q.qlen--; | 115 | sch->q.qlen--; |
116 | return skb; | 116 | return skb; |
117 | } | 117 | } |
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c index c26ef3614f7e..64f0d3293b49 100644 --- a/net/sched/sch_netem.c +++ b/net/sched/sch_netem.c | |||
@@ -240,7 +240,6 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
240 | 240 | ||
241 | if (likely(ret == NET_XMIT_SUCCESS)) { | 241 | if (likely(ret == NET_XMIT_SUCCESS)) { |
242 | sch->q.qlen++; | 242 | sch->q.qlen++; |
243 | qdisc_bstats_update(sch, skb); | ||
244 | } else if (net_xmit_drop_count(ret)) { | 243 | } else if (net_xmit_drop_count(ret)) { |
245 | sch->qstats.drops++; | 244 | sch->qstats.drops++; |
246 | } | 245 | } |
@@ -289,6 +288,7 @@ static struct sk_buff *netem_dequeue(struct Qdisc *sch) | |||
289 | skb->tstamp.tv64 = 0; | 288 | skb->tstamp.tv64 = 0; |
290 | #endif | 289 | #endif |
291 | pr_debug("netem_dequeue: return skb=%p\n", skb); | 290 | pr_debug("netem_dequeue: return skb=%p\n", skb); |
291 | qdisc_bstats_update(sch, skb); | ||
292 | sch->q.qlen--; | 292 | sch->q.qlen--; |
293 | return skb; | 293 | return skb; |
294 | } | 294 | } |
@@ -476,7 +476,6 @@ static int tfifo_enqueue(struct sk_buff *nskb, struct Qdisc *sch) | |||
476 | __skb_queue_after(list, skb, nskb); | 476 | __skb_queue_after(list, skb, nskb); |
477 | 477 | ||
478 | sch->qstats.backlog += qdisc_pkt_len(nskb); | 478 | sch->qstats.backlog += qdisc_pkt_len(nskb); |
479 | qdisc_bstats_update(sch, nskb); | ||
480 | 479 | ||
481 | return NET_XMIT_SUCCESS; | 480 | return NET_XMIT_SUCCESS; |
482 | } | 481 | } |
diff --git a/net/sched/sch_prio.c b/net/sched/sch_prio.c index 3bea31e101b5..2a318f2dc3e5 100644 --- a/net/sched/sch_prio.c +++ b/net/sched/sch_prio.c | |||
@@ -83,7 +83,6 @@ prio_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
83 | 83 | ||
84 | ret = qdisc_enqueue(skb, qdisc); | 84 | ret = qdisc_enqueue(skb, qdisc); |
85 | if (ret == NET_XMIT_SUCCESS) { | 85 | if (ret == NET_XMIT_SUCCESS) { |
86 | qdisc_bstats_update(sch, skb); | ||
87 | sch->q.qlen++; | 86 | sch->q.qlen++; |
88 | return NET_XMIT_SUCCESS; | 87 | return NET_XMIT_SUCCESS; |
89 | } | 88 | } |
@@ -115,6 +114,7 @@ static struct sk_buff *prio_dequeue(struct Qdisc *sch) | |||
115 | struct Qdisc *qdisc = q->queues[prio]; | 114 | struct Qdisc *qdisc = q->queues[prio]; |
116 | struct sk_buff *skb = qdisc->dequeue(qdisc); | 115 | struct sk_buff *skb = qdisc->dequeue(qdisc); |
117 | if (skb) { | 116 | if (skb) { |
117 | qdisc_bstats_update(sch, skb); | ||
118 | sch->q.qlen--; | 118 | sch->q.qlen--; |
119 | return skb; | 119 | return skb; |
120 | } | 120 | } |
diff --git a/net/sched/sch_red.c b/net/sched/sch_red.c index 689157555fa4..6649463da1b6 100644 --- a/net/sched/sch_red.c +++ b/net/sched/sch_red.c | |||
@@ -93,7 +93,6 @@ static int red_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
93 | 93 | ||
94 | ret = qdisc_enqueue(skb, child); | 94 | ret = qdisc_enqueue(skb, child); |
95 | if (likely(ret == NET_XMIT_SUCCESS)) { | 95 | if (likely(ret == NET_XMIT_SUCCESS)) { |
96 | qdisc_bstats_update(sch, skb); | ||
97 | sch->q.qlen++; | 96 | sch->q.qlen++; |
98 | } else if (net_xmit_drop_count(ret)) { | 97 | } else if (net_xmit_drop_count(ret)) { |
99 | q->stats.pdrop++; | 98 | q->stats.pdrop++; |
@@ -113,11 +112,13 @@ static struct sk_buff *red_dequeue(struct Qdisc *sch) | |||
113 | struct Qdisc *child = q->qdisc; | 112 | struct Qdisc *child = q->qdisc; |
114 | 113 | ||
115 | skb = child->dequeue(child); | 114 | skb = child->dequeue(child); |
116 | if (skb) | 115 | if (skb) { |
116 | qdisc_bstats_update(sch, skb); | ||
117 | sch->q.qlen--; | 117 | sch->q.qlen--; |
118 | else if (!red_is_idling(&q->parms)) | 118 | } else { |
119 | red_start_of_idle_period(&q->parms); | 119 | if (!red_is_idling(&q->parms)) |
120 | 120 | red_start_of_idle_period(&q->parms); | |
121 | } | ||
121 | return skb; | 122 | return skb; |
122 | } | 123 | } |
123 | 124 | ||
diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c index fdba52aa053d..4cff44235773 100644 --- a/net/sched/sch_sfq.c +++ b/net/sched/sch_sfq.c | |||
@@ -402,10 +402,8 @@ sfq_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
402 | q->tail = slot; | 402 | q->tail = slot; |
403 | slot->allot = q->scaled_quantum; | 403 | slot->allot = q->scaled_quantum; |
404 | } | 404 | } |
405 | if (++sch->q.qlen <= q->limit) { | 405 | if (++sch->q.qlen <= q->limit) |
406 | qdisc_bstats_update(sch, skb); | ||
407 | return NET_XMIT_SUCCESS; | 406 | return NET_XMIT_SUCCESS; |
408 | } | ||
409 | 407 | ||
410 | sfq_drop(sch); | 408 | sfq_drop(sch); |
411 | return NET_XMIT_CN; | 409 | return NET_XMIT_CN; |
@@ -445,6 +443,7 @@ next_slot: | |||
445 | } | 443 | } |
446 | skb = slot_dequeue_head(slot); | 444 | skb = slot_dequeue_head(slot); |
447 | sfq_dec(q, a); | 445 | sfq_dec(q, a); |
446 | qdisc_bstats_update(sch, skb); | ||
448 | sch->q.qlen--; | 447 | sch->q.qlen--; |
449 | sch->qstats.backlog -= qdisc_pkt_len(skb); | 448 | sch->qstats.backlog -= qdisc_pkt_len(skb); |
450 | 449 | ||
diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c index 86c016696977..1dcfb5223a86 100644 --- a/net/sched/sch_tbf.c +++ b/net/sched/sch_tbf.c | |||
@@ -133,7 +133,6 @@ static int tbf_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
133 | } | 133 | } |
134 | 134 | ||
135 | sch->q.qlen++; | 135 | sch->q.qlen++; |
136 | qdisc_bstats_update(sch, skb); | ||
137 | return NET_XMIT_SUCCESS; | 136 | return NET_XMIT_SUCCESS; |
138 | } | 137 | } |
139 | 138 | ||
@@ -186,6 +185,7 @@ static struct sk_buff *tbf_dequeue(struct Qdisc *sch) | |||
186 | q->ptokens = ptoks; | 185 | q->ptokens = ptoks; |
187 | sch->q.qlen--; | 186 | sch->q.qlen--; |
188 | qdisc_unthrottled(sch); | 187 | qdisc_unthrottled(sch); |
188 | qdisc_bstats_update(sch, skb); | ||
189 | return skb; | 189 | return skb; |
190 | } | 190 | } |
191 | 191 | ||
diff --git a/net/sched/sch_teql.c b/net/sched/sch_teql.c index 64c071ded0f4..45cd30098e34 100644 --- a/net/sched/sch_teql.c +++ b/net/sched/sch_teql.c | |||
@@ -85,7 +85,6 @@ teql_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
85 | 85 | ||
86 | if (q->q.qlen < dev->tx_queue_len) { | 86 | if (q->q.qlen < dev->tx_queue_len) { |
87 | __skb_queue_tail(&q->q, skb); | 87 | __skb_queue_tail(&q->q, skb); |
88 | qdisc_bstats_update(sch, skb); | ||
89 | return NET_XMIT_SUCCESS; | 88 | return NET_XMIT_SUCCESS; |
90 | } | 89 | } |
91 | 90 | ||
@@ -109,6 +108,8 @@ teql_dequeue(struct Qdisc *sch) | |||
109 | dat->m->slaves = sch; | 108 | dat->m->slaves = sch; |
110 | netif_wake_queue(m); | 109 | netif_wake_queue(m); |
111 | } | 110 | } |
111 | } else { | ||
112 | qdisc_bstats_update(sch, skb); | ||
112 | } | 113 | } |
113 | sch->q.qlen = dat->q.qlen + dat_queue->qdisc->q.qlen; | 114 | sch->q.qlen = dat->q.qlen + dat_queue->qdisc->q.qlen; |
114 | return skb; | 115 | return skb; |