aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_htb.c
diff options
context:
space:
mode:
authorJussi Kivilinna <jussi.kivilinna@mbnet.fi>2008-07-20 03:08:27 -0400
committerDavid S. Miller <davem@davemloft.net>2008-07-20 03:08:27 -0400
commit0abf77e55a2459aa9905be4b226e4729d5b4f0cb (patch)
tree0224961150c0c2c65b5ad407b1af8cf84266e919 /net/sched/sch_htb.c
parent5f86173bdf15981ca49d0434f638b68f70a35644 (diff)
net_sched: Add accessor function for packet length for qdiscs
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_htb.c')
-rw-r--r--net/sched/sch_htb.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index 72b5a946178f..30c999c61b01 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -579,13 +579,13 @@ static int htb_enqueue(struct sk_buff *skb, struct Qdisc *sch)
579 } else { 579 } else {
580 cl->bstats.packets += 580 cl->bstats.packets +=
581 skb_is_gso(skb)?skb_shinfo(skb)->gso_segs:1; 581 skb_is_gso(skb)?skb_shinfo(skb)->gso_segs:1;
582 cl->bstats.bytes += skb->len; 582 cl->bstats.bytes += qdisc_pkt_len(skb);
583 htb_activate(q, cl); 583 htb_activate(q, cl);
584 } 584 }
585 585
586 sch->q.qlen++; 586 sch->q.qlen++;
587 sch->bstats.packets += skb_is_gso(skb)?skb_shinfo(skb)->gso_segs:1; 587 sch->bstats.packets += skb_is_gso(skb)?skb_shinfo(skb)->gso_segs:1;
588 sch->bstats.bytes += skb->len; 588 sch->bstats.bytes += qdisc_pkt_len(skb);
589 return NET_XMIT_SUCCESS; 589 return NET_XMIT_SUCCESS;
590} 590}
591 591
@@ -642,7 +642,7 @@ static int htb_requeue(struct sk_buff *skb, struct Qdisc *sch)
642static void htb_charge_class(struct htb_sched *q, struct htb_class *cl, 642static void htb_charge_class(struct htb_sched *q, struct htb_class *cl,
643 int level, struct sk_buff *skb) 643 int level, struct sk_buff *skb)
644{ 644{
645 int bytes = skb->len; 645 int bytes = qdisc_pkt_len(skb);
646 long toks, diff; 646 long toks, diff;
647 enum htb_cmode old_mode; 647 enum htb_cmode old_mode;
648 648
@@ -855,7 +855,8 @@ next:
855 } while (cl != start); 855 } while (cl != start);
856 856
857 if (likely(skb != NULL)) { 857 if (likely(skb != NULL)) {
858 if ((cl->un.leaf.deficit[level] -= skb->len) < 0) { 858 cl->un.leaf.deficit[level] -= qdisc_pkt_len(skb);
859 if (cl->un.leaf.deficit[level] < 0) {
859 cl->un.leaf.deficit[level] += cl->un.leaf.quantum; 860 cl->un.leaf.deficit[level] += cl->un.leaf.quantum;
860 htb_next_rb_node((level ? cl->parent->un.inner.ptr : q-> 861 htb_next_rb_node((level ? cl->parent->un.inner.ptr : q->
861 ptr[0]) + prio); 862 ptr[0]) + prio);