diff options
| -rw-r--r-- | include/net/sch_generic.h | 20 | ||||
| -rw-r--r-- | net/core/dev.c | 5 | ||||
| -rw-r--r-- | net/sched/act_csum.c | 3 | ||||
| -rw-r--r-- | net/sched/act_ipt.c | 3 | ||||
| -rw-r--r-- | net/sched/act_mirred.c | 3 | ||||
| -rw-r--r-- | net/sched/act_nat.c | 3 | ||||
| -rw-r--r-- | net/sched/act_pedit.c | 3 | ||||
| -rw-r--r-- | net/sched/act_police.c | 3 | ||||
| -rw-r--r-- | net/sched/act_simple.c | 3 | ||||
| -rw-r--r-- | net/sched/act_skbedit.c | 3 | ||||
| -rw-r--r-- | net/sched/sch_atm.c | 6 | ||||
| -rw-r--r-- | net/sched/sch_cbq.c | 6 | ||||
| -rw-r--r-- | net/sched/sch_drr.c | 8 | ||||
| -rw-r--r-- | net/sched/sch_dsmark.c | 3 | ||||
| -rw-r--r-- | net/sched/sch_hfsc.c | 6 | ||||
| -rw-r--r-- | net/sched/sch_htb.c | 17 | ||||
| -rw-r--r-- | net/sched/sch_ingress.c | 3 | ||||
| -rw-r--r-- | net/sched/sch_multiq.c | 3 | ||||
| -rw-r--r-- | net/sched/sch_netem.c | 6 | ||||
| -rw-r--r-- | net/sched/sch_prio.c | 3 | ||||
| -rw-r--r-- | net/sched/sch_red.c | 3 | ||||
| -rw-r--r-- | net/sched/sch_sfq.c | 3 | ||||
| -rw-r--r-- | net/sched/sch_tbf.c | 3 | ||||
| -rw-r--r-- | net/sched/sch_teql.c | 3 |
24 files changed, 50 insertions, 72 deletions
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index 0af57ebae76..e9eee99d8b1 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h | |||
| @@ -207,7 +207,7 @@ static inline int qdisc_qlen(struct Qdisc *q) | |||
| 207 | return q->q.qlen; | 207 | return q->q.qlen; |
| 208 | } | 208 | } |
| 209 | 209 | ||
| 210 | static inline struct qdisc_skb_cb *qdisc_skb_cb(struct sk_buff *skb) | 210 | static inline struct qdisc_skb_cb *qdisc_skb_cb(const struct sk_buff *skb) |
| 211 | { | 211 | { |
| 212 | return (struct qdisc_skb_cb *)skb->cb; | 212 | return (struct qdisc_skb_cb *)skb->cb; |
| 213 | } | 213 | } |
| @@ -394,7 +394,7 @@ static inline bool qdisc_tx_is_noop(const struct net_device *dev) | |||
| 394 | return true; | 394 | return true; |
| 395 | } | 395 | } |
| 396 | 396 | ||
| 397 | static inline unsigned int qdisc_pkt_len(struct sk_buff *skb) | 397 | static inline unsigned int qdisc_pkt_len(const struct sk_buff *skb) |
| 398 | { | 398 | { |
| 399 | return qdisc_skb_cb(skb)->pkt_len; | 399 | return qdisc_skb_cb(skb)->pkt_len; |
| 400 | } | 400 | } |
| @@ -426,10 +426,18 @@ static inline int qdisc_enqueue_root(struct sk_buff *skb, struct Qdisc *sch) | |||
| 426 | return qdisc_enqueue(skb, sch) & NET_XMIT_MASK; | 426 | return qdisc_enqueue(skb, sch) & NET_XMIT_MASK; |
| 427 | } | 427 | } |
| 428 | 428 | ||
| 429 | static inline void __qdisc_update_bstats(struct Qdisc *sch, unsigned int len) | 429 | |
| 430 | static inline void bstats_update(struct gnet_stats_basic_packed *bstats, | ||
| 431 | const struct sk_buff *skb) | ||
| 432 | { | ||
| 433 | bstats->bytes += qdisc_pkt_len(skb); | ||
| 434 | bstats->packets += skb_is_gso(skb) ? skb_shinfo(skb)->gso_segs : 1; | ||
| 435 | } | ||
| 436 | |||
| 437 | static inline void qdisc_bstats_update(struct Qdisc *sch, | ||
| 438 | const struct sk_buff *skb) | ||
| 430 | { | 439 | { |
| 431 | sch->bstats.bytes += len; | 440 | bstats_update(&sch->bstats, skb); |
| 432 | sch->bstats.packets++; | ||
| 433 | } | 441 | } |
| 434 | 442 | ||
| 435 | static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch, | 443 | static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch, |
| @@ -437,7 +445,7 @@ static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch, | |||
| 437 | { | 445 | { |
| 438 | __skb_queue_tail(list, skb); | 446 | __skb_queue_tail(list, skb); |
| 439 | sch->qstats.backlog += qdisc_pkt_len(skb); | 447 | sch->qstats.backlog += qdisc_pkt_len(skb); |
| 440 | __qdisc_update_bstats(sch, qdisc_pkt_len(skb)); | 448 | qdisc_bstats_update(sch, skb); |
| 441 | 449 | ||
| 442 | return NET_XMIT_SUCCESS; | 450 | return NET_XMIT_SUCCESS; |
| 443 | } | 451 | } |
diff --git a/net/core/dev.c b/net/core/dev.c index 3295b94884a..a3ef808b5e3 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
| @@ -2297,7 +2297,10 @@ static inline int __dev_xmit_skb(struct sk_buff *skb, struct Qdisc *q, | |||
| 2297 | */ | 2297 | */ |
| 2298 | if (!(dev->priv_flags & IFF_XMIT_DST_RELEASE)) | 2298 | if (!(dev->priv_flags & IFF_XMIT_DST_RELEASE)) |
| 2299 | skb_dst_force(skb); | 2299 | skb_dst_force(skb); |
| 2300 | __qdisc_update_bstats(q, skb->len); | 2300 | |
| 2301 | qdisc_skb_cb(skb)->pkt_len = skb->len; | ||
| 2302 | qdisc_bstats_update(q, skb); | ||
| 2303 | |||
| 2301 | if (sch_direct_xmit(skb, q, dev, txq, root_lock)) { | 2304 | if (sch_direct_xmit(skb, q, dev, txq, root_lock)) { |
| 2302 | if (unlikely(contended)) { | 2305 | if (unlikely(contended)) { |
| 2303 | spin_unlock(&q->busylock); | 2306 | spin_unlock(&q->busylock); |
diff --git a/net/sched/act_csum.c b/net/sched/act_csum.c index 67dc7ce9b63..83ddfc07e45 100644 --- a/net/sched/act_csum.c +++ b/net/sched/act_csum.c | |||
| @@ -508,8 +508,7 @@ static int tcf_csum(struct sk_buff *skb, | |||
| 508 | 508 | ||
| 509 | spin_lock(&p->tcf_lock); | 509 | spin_lock(&p->tcf_lock); |
| 510 | p->tcf_tm.lastuse = jiffies; | 510 | p->tcf_tm.lastuse = jiffies; |
| 511 | p->tcf_bstats.bytes += qdisc_pkt_len(skb); | 511 | bstats_update(&p->tcf_bstats, skb); |
| 512 | p->tcf_bstats.packets++; | ||
| 513 | action = p->tcf_action; | 512 | action = p->tcf_action; |
| 514 | update_flags = p->update_flags; | 513 | update_flags = p->update_flags; |
| 515 | spin_unlock(&p->tcf_lock); | 514 | spin_unlock(&p->tcf_lock); |
diff --git a/net/sched/act_ipt.c b/net/sched/act_ipt.c index 8daef963225..c2a7c20e81c 100644 --- a/net/sched/act_ipt.c +++ b/net/sched/act_ipt.c | |||
| @@ -209,8 +209,7 @@ static int tcf_ipt(struct sk_buff *skb, struct tc_action *a, | |||
| 209 | spin_lock(&ipt->tcf_lock); | 209 | spin_lock(&ipt->tcf_lock); |
| 210 | 210 | ||
| 211 | ipt->tcf_tm.lastuse = jiffies; | 211 | ipt->tcf_tm.lastuse = jiffies; |
| 212 | ipt->tcf_bstats.bytes += qdisc_pkt_len(skb); | 212 | bstats_update(&ipt->tcf_bstats, skb); |
| 213 | ipt->tcf_bstats.packets++; | ||
| 214 | 213 | ||
| 215 | /* yes, we have to worry about both in and out dev | 214 | /* yes, we have to worry about both in and out dev |
| 216 | worry later - danger - this API seems to have changed | 215 | worry later - danger - this API seems to have changed |
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c index 0c311be9282..d765067e99d 100644 --- a/net/sched/act_mirred.c +++ b/net/sched/act_mirred.c | |||
| @@ -165,8 +165,7 @@ static int tcf_mirred(struct sk_buff *skb, struct tc_action *a, | |||
| 165 | 165 | ||
| 166 | spin_lock(&m->tcf_lock); | 166 | spin_lock(&m->tcf_lock); |
| 167 | m->tcf_tm.lastuse = jiffies; | 167 | m->tcf_tm.lastuse = jiffies; |
| 168 | m->tcf_bstats.bytes += qdisc_pkt_len(skb); | 168 | bstats_update(&m->tcf_bstats, skb); |
| 169 | m->tcf_bstats.packets++; | ||
| 170 | 169 | ||
| 171 | dev = m->tcfm_dev; | 170 | dev = m->tcfm_dev; |
| 172 | if (!dev) { | 171 | if (!dev) { |
diff --git a/net/sched/act_nat.c b/net/sched/act_nat.c index 186eb837e60..178a4bd7b7c 100644 --- a/net/sched/act_nat.c +++ b/net/sched/act_nat.c | |||
| @@ -125,8 +125,7 @@ static int tcf_nat(struct sk_buff *skb, struct tc_action *a, | |||
| 125 | egress = p->flags & TCA_NAT_FLAG_EGRESS; | 125 | egress = p->flags & TCA_NAT_FLAG_EGRESS; |
| 126 | action = p->tcf_action; | 126 | action = p->tcf_action; |
| 127 | 127 | ||
| 128 | p->tcf_bstats.bytes += qdisc_pkt_len(skb); | 128 | bstats_update(&p->tcf_bstats, skb); |
| 129 | p->tcf_bstats.packets++; | ||
| 130 | 129 | ||
| 131 | spin_unlock(&p->tcf_lock); | 130 | spin_unlock(&p->tcf_lock); |
| 132 | 131 | ||
diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c index a0593c9640d..445bef716f7 100644 --- a/net/sched/act_pedit.c +++ b/net/sched/act_pedit.c | |||
| @@ -187,8 +187,7 @@ static int tcf_pedit(struct sk_buff *skb, struct tc_action *a, | |||
| 187 | bad: | 187 | bad: |
| 188 | p->tcf_qstats.overlimits++; | 188 | p->tcf_qstats.overlimits++; |
| 189 | done: | 189 | done: |
| 190 | p->tcf_bstats.bytes += qdisc_pkt_len(skb); | 190 | bstats_update(&p->tcf_bstats, skb); |
| 191 | p->tcf_bstats.packets++; | ||
| 192 | spin_unlock(&p->tcf_lock); | 191 | spin_unlock(&p->tcf_lock); |
| 193 | return p->tcf_action; | 192 | return p->tcf_action; |
| 194 | } | 193 | } |
diff --git a/net/sched/act_police.c b/net/sched/act_police.c index 7ebf7439b47..e2f08b1e2e5 100644 --- a/net/sched/act_police.c +++ b/net/sched/act_police.c | |||
| @@ -298,8 +298,7 @@ static int tcf_act_police(struct sk_buff *skb, struct tc_action *a, | |||
| 298 | 298 | ||
| 299 | spin_lock(&police->tcf_lock); | 299 | spin_lock(&police->tcf_lock); |
| 300 | 300 | ||
| 301 | police->tcf_bstats.bytes += qdisc_pkt_len(skb); | 301 | bstats_update(&police->tcf_bstats, skb); |
| 302 | police->tcf_bstats.packets++; | ||
| 303 | 302 | ||
| 304 | if (police->tcfp_ewma_rate && | 303 | if (police->tcfp_ewma_rate && |
| 305 | police->tcf_rate_est.bps >= police->tcfp_ewma_rate) { | 304 | police->tcf_rate_est.bps >= police->tcfp_ewma_rate) { |
diff --git a/net/sched/act_simple.c b/net/sched/act_simple.c index 97e84f3ee77..7287cff7af3 100644 --- a/net/sched/act_simple.c +++ b/net/sched/act_simple.c | |||
| @@ -42,8 +42,7 @@ static int tcf_simp(struct sk_buff *skb, struct tc_action *a, struct tcf_result | |||
| 42 | 42 | ||
| 43 | spin_lock(&d->tcf_lock); | 43 | spin_lock(&d->tcf_lock); |
| 44 | d->tcf_tm.lastuse = jiffies; | 44 | d->tcf_tm.lastuse = jiffies; |
| 45 | d->tcf_bstats.bytes += qdisc_pkt_len(skb); | 45 | bstats_update(&d->tcf_bstats, skb); |
| 46 | d->tcf_bstats.packets++; | ||
| 47 | 46 | ||
| 48 | /* print policy string followed by _ then packet count | 47 | /* print policy string followed by _ then packet count |
| 49 | * Example if this was the 3rd packet and the string was "hello" | 48 | * Example if this was the 3rd packet and the string was "hello" |
diff --git a/net/sched/act_skbedit.c b/net/sched/act_skbedit.c index 66cbf4eb885..836f5fee9e5 100644 --- a/net/sched/act_skbedit.c +++ b/net/sched/act_skbedit.c | |||
| @@ -46,8 +46,7 @@ static int tcf_skbedit(struct sk_buff *skb, struct tc_action *a, | |||
| 46 | 46 | ||
| 47 | spin_lock(&d->tcf_lock); | 47 | spin_lock(&d->tcf_lock); |
| 48 | d->tcf_tm.lastuse = jiffies; | 48 | d->tcf_tm.lastuse = jiffies; |
| 49 | d->tcf_bstats.bytes += qdisc_pkt_len(skb); | 49 | bstats_update(&d->tcf_bstats, skb); |
| 50 | d->tcf_bstats.packets++; | ||
| 51 | 50 | ||
| 52 | if (d->flags & SKBEDIT_F_PRIORITY) | 51 | if (d->flags & SKBEDIT_F_PRIORITY) |
| 53 | skb->priority = d->priority; | 52 | skb->priority = d->priority; |
diff --git a/net/sched/sch_atm.c b/net/sched/sch_atm.c index 282540778aa..943d733409d 100644 --- a/net/sched/sch_atm.c +++ b/net/sched/sch_atm.c | |||
| @@ -422,10 +422,8 @@ drop: __maybe_unused | |||
| 422 | } | 422 | } |
| 423 | return ret; | 423 | return ret; |
| 424 | } | 424 | } |
| 425 | sch->bstats.bytes += qdisc_pkt_len(skb); | 425 | qdisc_bstats_update(sch, skb); |
| 426 | sch->bstats.packets++; | 426 | bstats_update(&flow->bstats, skb); |
| 427 | flow->bstats.bytes += qdisc_pkt_len(skb); | ||
| 428 | flow->bstats.packets++; | ||
| 429 | /* | 427 | /* |
| 430 | * Okay, this may seem weird. We pretend we've dropped the packet if | 428 | * Okay, this may seem weird. We pretend we've dropped the packet if |
| 431 | * it goes via ATM. The reason for this is that the outer qdisc | 429 | * it goes via ATM. The reason for this is that the outer qdisc |
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c index eb763159086..c80d1c210c5 100644 --- a/net/sched/sch_cbq.c +++ b/net/sched/sch_cbq.c | |||
| @@ -390,8 +390,7 @@ cbq_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
| 390 | ret = qdisc_enqueue(skb, cl->q); | 390 | ret = qdisc_enqueue(skb, cl->q); |
| 391 | if (ret == NET_XMIT_SUCCESS) { | 391 | if (ret == NET_XMIT_SUCCESS) { |
| 392 | sch->q.qlen++; | 392 | sch->q.qlen++; |
| 393 | sch->bstats.packets++; | 393 | qdisc_bstats_update(sch, skb); |
| 394 | sch->bstats.bytes += qdisc_pkt_len(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,8 +649,7 @@ 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 | sch->bstats.packets++; | 652 | qdisc_bstats_update(sch, skb); |
| 654 | sch->bstats.bytes += qdisc_pkt_len(skb); | ||
| 655 | if (!cl->next_alive) | 653 | if (!cl->next_alive) |
| 656 | cbq_activate_class(cl); | 654 | cbq_activate_class(cl); |
| 657 | return 0; | 655 | return 0; |
diff --git a/net/sched/sch_drr.c b/net/sched/sch_drr.c index aa8b5313f8c..de55e642eaf 100644 --- a/net/sched/sch_drr.c +++ b/net/sched/sch_drr.c | |||
| @@ -351,7 +351,6 @@ static int drr_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
| 351 | { | 351 | { |
| 352 | struct drr_sched *q = qdisc_priv(sch); | 352 | struct drr_sched *q = qdisc_priv(sch); |
| 353 | struct drr_class *cl; | 353 | struct drr_class *cl; |
| 354 | unsigned int len; | ||
| 355 | int err; | 354 | int err; |
| 356 | 355 | ||
| 357 | cl = drr_classify(skb, sch, &err); | 356 | cl = drr_classify(skb, sch, &err); |
| @@ -362,7 +361,6 @@ static int drr_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
| 362 | return err; | 361 | return err; |
| 363 | } | 362 | } |
| 364 | 363 | ||
| 365 | len = qdisc_pkt_len(skb); | ||
| 366 | err = qdisc_enqueue(skb, cl->qdisc); | 364 | err = qdisc_enqueue(skb, cl->qdisc); |
| 367 | if (unlikely(err != NET_XMIT_SUCCESS)) { | 365 | if (unlikely(err != NET_XMIT_SUCCESS)) { |
| 368 | if (net_xmit_drop_count(err)) { | 366 | if (net_xmit_drop_count(err)) { |
| @@ -377,10 +375,8 @@ static int drr_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
| 377 | cl->deficit = cl->quantum; | 375 | cl->deficit = cl->quantum; |
| 378 | } | 376 | } |
| 379 | 377 | ||
| 380 | cl->bstats.packets++; | 378 | bstats_update(&cl->bstats, skb); |
| 381 | cl->bstats.bytes += len; | 379 | qdisc_bstats_update(sch, skb); |
| 382 | sch->bstats.packets++; | ||
| 383 | sch->bstats.bytes += len; | ||
| 384 | 380 | ||
| 385 | sch->q.qlen++; | 381 | sch->q.qlen++; |
| 386 | return err; | 382 | return err; |
diff --git a/net/sched/sch_dsmark.c b/net/sched/sch_dsmark.c index 1d295d62bb5..60f4bdd4408 100644 --- a/net/sched/sch_dsmark.c +++ b/net/sched/sch_dsmark.c | |||
| @@ -260,8 +260,7 @@ static int dsmark_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
| 260 | return err; | 260 | return err; |
| 261 | } | 261 | } |
| 262 | 262 | ||
| 263 | sch->bstats.bytes += qdisc_pkt_len(skb); | 263 | qdisc_bstats_update(sch, skb); |
| 264 | sch->bstats.packets++; | ||
| 265 | sch->q.qlen++; | 264 | sch->q.qlen++; |
| 266 | 265 | ||
| 267 | return NET_XMIT_SUCCESS; | 266 | return NET_XMIT_SUCCESS; |
diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c index 069c62b7bb3..2e45791d4f6 100644 --- a/net/sched/sch_hfsc.c +++ b/net/sched/sch_hfsc.c | |||
| @@ -1599,10 +1599,8 @@ hfsc_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
| 1599 | if (cl->qdisc->q.qlen == 1) | 1599 | if (cl->qdisc->q.qlen == 1) |
| 1600 | set_active(cl, qdisc_pkt_len(skb)); | 1600 | set_active(cl, qdisc_pkt_len(skb)); |
| 1601 | 1601 | ||
| 1602 | cl->bstats.packets++; | 1602 | bstats_update(&cl->bstats, skb); |
| 1603 | cl->bstats.bytes += qdisc_pkt_len(skb); | 1603 | qdisc_bstats_update(sch, skb); |
| 1604 | sch->bstats.packets++; | ||
| 1605 | sch->bstats.bytes += qdisc_pkt_len(skb); | ||
| 1606 | sch->q.qlen++; | 1604 | sch->q.qlen++; |
| 1607 | 1605 | ||
| 1608 | return NET_XMIT_SUCCESS; | 1606 | return NET_XMIT_SUCCESS; |
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c index 01b519d6c52..984c1b0c683 100644 --- a/net/sched/sch_htb.c +++ b/net/sched/sch_htb.c | |||
| @@ -569,15 +569,12 @@ static int htb_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
| 569 | } | 569 | } |
| 570 | return ret; | 570 | return ret; |
| 571 | } else { | 571 | } else { |
| 572 | cl->bstats.packets += | 572 | bstats_update(&cl->bstats, skb); |
| 573 | skb_is_gso(skb)?skb_shinfo(skb)->gso_segs:1; | ||
| 574 | cl->bstats.bytes += qdisc_pkt_len(skb); | ||
| 575 | htb_activate(q, cl); | 573 | htb_activate(q, cl); |
| 576 | } | 574 | } |
| 577 | 575 | ||
| 578 | sch->q.qlen++; | 576 | sch->q.qlen++; |
| 579 | sch->bstats.packets += skb_is_gso(skb)?skb_shinfo(skb)->gso_segs:1; | 577 | qdisc_bstats_update(sch, skb); |
| 580 | sch->bstats.bytes += qdisc_pkt_len(skb); | ||
| 581 | return NET_XMIT_SUCCESS; | 578 | return NET_XMIT_SUCCESS; |
| 582 | } | 579 | } |
| 583 | 580 | ||
| @@ -648,12 +645,10 @@ static void htb_charge_class(struct htb_sched *q, struct htb_class *cl, | |||
| 648 | htb_add_to_wait_tree(q, cl, diff); | 645 | htb_add_to_wait_tree(q, cl, diff); |
| 649 | } | 646 | } |
| 650 | 647 | ||
| 651 | /* update byte stats except for leaves which are already updated */ | 648 | /* update basic stats except for leaves which are already updated */ |
| 652 | if (cl->level) { | 649 | if (cl->level) |
| 653 | cl->bstats.bytes += bytes; | 650 | bstats_update(&cl->bstats, skb); |
| 654 | cl->bstats.packets += skb_is_gso(skb)? | 651 | |
| 655 | skb_shinfo(skb)->gso_segs:1; | ||
| 656 | } | ||
| 657 | cl = cl->parent; | 652 | cl = cl->parent; |
| 658 | } | 653 | } |
| 659 | } | 654 | } |
diff --git a/net/sched/sch_ingress.c b/net/sched/sch_ingress.c index f10e34a6844..bce1665239b 100644 --- a/net/sched/sch_ingress.c +++ b/net/sched/sch_ingress.c | |||
| @@ -63,8 +63,7 @@ static int ingress_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
| 63 | 63 | ||
| 64 | result = tc_classify(skb, p->filter_list, &res); | 64 | result = tc_classify(skb, p->filter_list, &res); |
| 65 | 65 | ||
| 66 | sch->bstats.packets++; | 66 | qdisc_bstats_update(sch, skb); |
| 67 | sch->bstats.bytes += qdisc_pkt_len(skb); | ||
| 68 | switch (result) { | 67 | switch (result) { |
| 69 | case TC_ACT_SHOT: | 68 | case TC_ACT_SHOT: |
| 70 | result = TC_ACT_SHOT; | 69 | result = TC_ACT_SHOT; |
diff --git a/net/sched/sch_multiq.c b/net/sched/sch_multiq.c index 32690deab5d..21f13da2476 100644 --- a/net/sched/sch_multiq.c +++ b/net/sched/sch_multiq.c | |||
| @@ -83,8 +83,7 @@ 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 | sch->bstats.bytes += qdisc_pkt_len(skb); | 86 | qdisc_bstats_update(sch, skb); |
| 87 | sch->bstats.packets++; | ||
| 88 | sch->q.qlen++; | 87 | sch->q.qlen++; |
| 89 | return NET_XMIT_SUCCESS; | 88 | return NET_XMIT_SUCCESS; |
| 90 | } | 89 | } |
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c index e5593c083a7..1c4bce86347 100644 --- a/net/sched/sch_netem.c +++ b/net/sched/sch_netem.c | |||
| @@ -240,8 +240,7 @@ 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 | sch->bstats.bytes += qdisc_pkt_len(skb); | 243 | qdisc_bstats_update(sch, skb); |
| 244 | sch->bstats.packets++; | ||
| 245 | } else if (net_xmit_drop_count(ret)) { | 244 | } else if (net_xmit_drop_count(ret)) { |
| 246 | sch->qstats.drops++; | 245 | sch->qstats.drops++; |
| 247 | } | 246 | } |
| @@ -477,8 +476,7 @@ static int tfifo_enqueue(struct sk_buff *nskb, struct Qdisc *sch) | |||
| 477 | __skb_queue_after(list, skb, nskb); | 476 | __skb_queue_after(list, skb, nskb); |
| 478 | 477 | ||
| 479 | sch->qstats.backlog += qdisc_pkt_len(nskb); | 478 | sch->qstats.backlog += qdisc_pkt_len(nskb); |
| 480 | sch->bstats.bytes += qdisc_pkt_len(nskb); | 479 | qdisc_bstats_update(sch, nskb); |
| 481 | sch->bstats.packets++; | ||
| 482 | 480 | ||
| 483 | return NET_XMIT_SUCCESS; | 481 | return NET_XMIT_SUCCESS; |
| 484 | } | 482 | } |
diff --git a/net/sched/sch_prio.c b/net/sched/sch_prio.c index b1c95bce33c..966158d49dd 100644 --- a/net/sched/sch_prio.c +++ b/net/sched/sch_prio.c | |||
| @@ -84,8 +84,7 @@ prio_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
| 84 | 84 | ||
| 85 | ret = qdisc_enqueue(skb, qdisc); | 85 | ret = qdisc_enqueue(skb, qdisc); |
| 86 | if (ret == NET_XMIT_SUCCESS) { | 86 | if (ret == NET_XMIT_SUCCESS) { |
| 87 | sch->bstats.bytes += qdisc_pkt_len(skb); | 87 | qdisc_bstats_update(sch, skb); |
| 88 | sch->bstats.packets++; | ||
| 89 | sch->q.qlen++; | 88 | sch->q.qlen++; |
| 90 | return NET_XMIT_SUCCESS; | 89 | return NET_XMIT_SUCCESS; |
| 91 | } | 90 | } |
diff --git a/net/sched/sch_red.c b/net/sched/sch_red.c index a67ba3c5a0c..a6009c5a2c9 100644 --- a/net/sched/sch_red.c +++ b/net/sched/sch_red.c | |||
| @@ -94,8 +94,7 @@ static int red_enqueue(struct sk_buff *skb, struct Qdisc* sch) | |||
| 94 | 94 | ||
| 95 | ret = qdisc_enqueue(skb, child); | 95 | ret = qdisc_enqueue(skb, child); |
| 96 | if (likely(ret == NET_XMIT_SUCCESS)) { | 96 | if (likely(ret == NET_XMIT_SUCCESS)) { |
| 97 | sch->bstats.bytes += qdisc_pkt_len(skb); | 97 | qdisc_bstats_update(sch, skb); |
| 98 | sch->bstats.packets++; | ||
| 99 | sch->q.qlen++; | 98 | sch->q.qlen++; |
| 100 | } else if (net_xmit_drop_count(ret)) { | 99 | } else if (net_xmit_drop_count(ret)) { |
| 101 | q->stats.pdrop++; | 100 | q->stats.pdrop++; |
diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c index d54ac94066c..239ec53a634 100644 --- a/net/sched/sch_sfq.c +++ b/net/sched/sch_sfq.c | |||
| @@ -403,8 +403,7 @@ sfq_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
| 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 | sch->bstats.bytes += qdisc_pkt_len(skb); | 406 | qdisc_bstats_update(sch, skb); |
| 407 | sch->bstats.packets++; | ||
| 408 | return NET_XMIT_SUCCESS; | 407 | return NET_XMIT_SUCCESS; |
| 409 | } | 408 | } |
| 410 | 409 | ||
diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c index 641a30d6463..77565e72181 100644 --- a/net/sched/sch_tbf.c +++ b/net/sched/sch_tbf.c | |||
| @@ -134,8 +134,7 @@ static int tbf_enqueue(struct sk_buff *skb, struct Qdisc* sch) | |||
| 134 | } | 134 | } |
| 135 | 135 | ||
| 136 | sch->q.qlen++; | 136 | sch->q.qlen++; |
| 137 | sch->bstats.bytes += qdisc_pkt_len(skb); | 137 | qdisc_bstats_update(sch, skb); |
| 138 | sch->bstats.packets++; | ||
| 139 | return NET_XMIT_SUCCESS; | 138 | return NET_XMIT_SUCCESS; |
| 140 | } | 139 | } |
| 141 | 140 | ||
diff --git a/net/sched/sch_teql.c b/net/sched/sch_teql.c index 106479a7c94..af9360d1f6e 100644 --- a/net/sched/sch_teql.c +++ b/net/sched/sch_teql.c | |||
| @@ -83,8 +83,7 @@ teql_enqueue(struct sk_buff *skb, struct Qdisc* sch) | |||
| 83 | 83 | ||
| 84 | if (q->q.qlen < dev->tx_queue_len) { | 84 | if (q->q.qlen < dev->tx_queue_len) { |
| 85 | __skb_queue_tail(&q->q, skb); | 85 | __skb_queue_tail(&q->q, skb); |
| 86 | sch->bstats.bytes += qdisc_pkt_len(skb); | 86 | qdisc_bstats_update(sch, skb); |
| 87 | sch->bstats.packets++; | ||
| 88 | return NET_XMIT_SUCCESS; | 87 | return NET_XMIT_SUCCESS; |
| 89 | } | 88 | } |
| 90 | 89 | ||
