aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_sfq.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sched/sch_sfq.c')
-rw-r--r--net/sched/sch_sfq.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c
index 3abab534eb5c..498f0a2cb47f 100644
--- a/net/sched/sch_sfq.c
+++ b/net/sched/sch_sfq.c
@@ -346,7 +346,7 @@ static int
346sfq_enqueue(struct sk_buff *skb, struct Qdisc *sch) 346sfq_enqueue(struct sk_buff *skb, struct Qdisc *sch)
347{ 347{
348 struct sfq_sched_data *q = qdisc_priv(sch); 348 struct sfq_sched_data *q = qdisc_priv(sch);
349 unsigned int hash; 349 unsigned int hash, dropped;
350 sfq_index x, qlen; 350 sfq_index x, qlen;
351 struct sfq_slot *slot; 351 struct sfq_slot *slot;
352 int uninitialized_var(ret); 352 int uninitialized_var(ret);
@@ -461,7 +461,7 @@ enqueue:
461 return NET_XMIT_SUCCESS; 461 return NET_XMIT_SUCCESS;
462 462
463 qlen = slot->qlen; 463 qlen = slot->qlen;
464 sfq_drop(sch); 464 dropped = sfq_drop(sch);
465 /* Return Congestion Notification only if we dropped a packet 465 /* Return Congestion Notification only if we dropped a packet
466 * from this flow. 466 * from this flow.
467 */ 467 */
@@ -469,7 +469,7 @@ enqueue:
469 return NET_XMIT_CN; 469 return NET_XMIT_CN;
470 470
471 /* As we dropped a packet, better let upper stack know this */ 471 /* As we dropped a packet, better let upper stack know this */
472 qdisc_tree_decrease_qlen(sch, 1); 472 qdisc_tree_reduce_backlog(sch, 1, dropped);
473 return NET_XMIT_SUCCESS; 473 return NET_XMIT_SUCCESS;
474} 474}
475 475
@@ -537,6 +537,7 @@ static void sfq_rehash(struct Qdisc *sch)
537 struct sfq_slot *slot; 537 struct sfq_slot *slot;
538 struct sk_buff_head list; 538 struct sk_buff_head list;
539 int dropped = 0; 539 int dropped = 0;
540 unsigned int drop_len = 0;
540 541
541 __skb_queue_head_init(&list); 542 __skb_queue_head_init(&list);
542 543
@@ -565,6 +566,7 @@ static void sfq_rehash(struct Qdisc *sch)
565 if (x >= SFQ_MAX_FLOWS) { 566 if (x >= SFQ_MAX_FLOWS) {
566drop: 567drop:
567 qdisc_qstats_backlog_dec(sch, skb); 568 qdisc_qstats_backlog_dec(sch, skb);
569 drop_len += qdisc_pkt_len(skb);
568 kfree_skb(skb); 570 kfree_skb(skb);
569 dropped++; 571 dropped++;
570 continue; 572 continue;
@@ -594,7 +596,7 @@ drop:
594 } 596 }
595 } 597 }
596 sch->q.qlen -= dropped; 598 sch->q.qlen -= dropped;
597 qdisc_tree_decrease_qlen(sch, dropped); 599 qdisc_tree_reduce_backlog(sch, dropped, drop_len);
598} 600}
599 601
600static void sfq_perturbation(unsigned long arg) 602static void sfq_perturbation(unsigned long arg)
@@ -618,7 +620,7 @@ static int sfq_change(struct Qdisc *sch, struct nlattr *opt)
618 struct sfq_sched_data *q = qdisc_priv(sch); 620 struct sfq_sched_data *q = qdisc_priv(sch);
619 struct tc_sfq_qopt *ctl = nla_data(opt); 621 struct tc_sfq_qopt *ctl = nla_data(opt);
620 struct tc_sfq_qopt_v1 *ctl_v1 = NULL; 622 struct tc_sfq_qopt_v1 *ctl_v1 = NULL;
621 unsigned int qlen; 623 unsigned int qlen, dropped = 0;
622 struct red_parms *p = NULL; 624 struct red_parms *p = NULL;
623 625
624 if (opt->nla_len < nla_attr_size(sizeof(*ctl))) 626 if (opt->nla_len < nla_attr_size(sizeof(*ctl)))
@@ -667,8 +669,8 @@ static int sfq_change(struct Qdisc *sch, struct nlattr *opt)
667 669
668 qlen = sch->q.qlen; 670 qlen = sch->q.qlen;
669 while (sch->q.qlen > q->limit) 671 while (sch->q.qlen > q->limit)
670 sfq_drop(sch); 672 dropped += sfq_drop(sch);
671 qdisc_tree_decrease_qlen(sch, qlen - sch->q.qlen); 673 qdisc_tree_reduce_backlog(sch, qlen - sch->q.qlen, dropped);
672 674
673 del_timer(&q->perturb_timer); 675 del_timer(&q->perturb_timer);
674 if (q->perturb_period) { 676 if (q->perturb_period) {