From: Jarek Poplawski <jarkao2@gmail.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Stephen Hemminger <shemminger@vyatta.com>,
Changli Gao <xiaosuo@gmail.com>,
David Miller <davem@davemloft.net>,
Fabio Checconi <fabio@gandalf.sssup.it>,
netdev@vger.kernel.org, Luigi Rizzo <rizzo@iet.unipi.it>
Subject: Re: [PATCH] net_sched: factorize qdisc stats handling
Date: Sat, 08 Jan 2011 14:35:31 +0100 [thread overview]
Message-ID: <4D286823.8050707@gmail.com> (raw)
In-Reply-To: <1294478789.2709.79.camel@edumazet-laptop>
Eric Dumazet wrote:
...
> -static inline void __qdisc_update_bstats(struct Qdisc *sch, unsigned int len)
> +
> +static inline void bstats_update(struct gnet_stats_basic_packed *bstats,
> + struct sk_buff *skb)
> +{
> + bstats->bytes += qdisc_pkt_len(skb);
> + bstats->packets += skb_is_gso(skb) ? skb_shinfo(skb)->gso_segs : 1;
> +}
> +
> +static inline void qdisc_bstats_update(struct Qdisc *sch, struct sk_buff *skb)
> {
> - sch->bstats.bytes += len;
> - sch->bstats.packets++;
> + bstats_update(&sch->bstats, skb);
> }
>
> static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch,
> @@ -437,7 +444,7 @@ static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch,
> {
> __skb_queue_tail(list, skb);
> sch->qstats.backlog += qdisc_pkt_len(skb);
> - __qdisc_update_bstats(sch, qdisc_pkt_len(skb));
> + qdisc_bstats_update(sch, skb);
>
> return NET_XMIT_SUCCESS;
> }
> diff --git a/net/core/dev.c b/net/core/dev.c
> index a215269..ab60f58 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -2301,7 +2301,7 @@ static inline int __dev_xmit_skb(struct sk_buff *skb, struct Qdisc *q,
> */
> if (!(dev->priv_flags & IFF_XMIT_DST_RELEASE))
> skb_dst_force(skb);
> - __qdisc_update_bstats(q, skb->len);
> + qdisc_bstats_update(q, skb);
> if (sch_direct_xmit(skb, q, dev, txq, root_lock)) {
> if (unlikely(contended)) {
> spin_unlock(&q->busylock);
I guess you can't use qdisc_pkt_len() without qdisc_enqueue_root().
Jarek P.
next prev parent reply other threads:[~2011-01-08 13:35 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-07 3:56 [RFC] sched: QFQ - quick fair queue scheduler Stephen Hemminger
2011-01-07 19:24 ` [RFC] sched: QFQ - quick fair queue scheduler (iproute2) Stephen Hemminger
2011-01-08 2:56 ` [RFC] sched: QFQ - quick fair queue scheduler Changli Gao
2011-01-08 4:02 ` Stephen Hemminger
2011-01-08 9:26 ` [PATCH] net_sched: factorize qdisc stats handling Eric Dumazet
2011-01-08 13:35 ` Jarek Poplawski [this message]
2011-01-08 15:40 ` Eric Dumazet
2011-01-09 17:57 ` Stephen Hemminger
2011-01-09 18:30 ` Eric Dumazet
2011-01-11 0:08 ` David Miller
2011-01-17 21:55 ` Jesper Dangaard Brouer
2011-01-17 22:04 ` Eric Dumazet
2011-01-08 4:34 ` [RFC] sched: QFQ - quick fair queue scheduler David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D286823.8050707@gmail.com \
--to=jarkao2@gmail.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=fabio@gandalf.sssup.it \
--cc=netdev@vger.kernel.org \
--cc=rizzo@iet.unipi.it \
--cc=shemminger@vyatta.com \
--cc=xiaosuo@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.