From: Eric Dumazet <eric.dumazet@gmail.com>
To: Sandeep Gopalpet <Sandeep.Kumar@freescale.com>
Cc: netdev@vger.kernel.org, avorontsov@ru.mvista.com, davem@davemloft.net
Subject: Re: [RFC] gianfar: Fix stats support
Date: Thu, 10 Dec 2009 07:13:07 +0100 [thread overview]
Message-ID: <4B209173.7030304@gmail.com> (raw)
In-Reply-To: <1260423764-21210-1-git-send-email-Sandeep.Kumar@freescale.com>
Le 10/12/2009 06:42, Sandeep Gopalpet a écrit :
> This patch updates the per rx/tx queue stats.
> To update the per rx queue stats a new structure has been
> introduced rx_q_stats.
> The per tx queue stats are updated via the netdev_queue
> structure itself.
>
> Note that we update only the tx_packtes, tx_bytes, rx_packets,
> rx_bytes and rx_dropped stats on a per queue basis.
>
> Signed-off-by: Sandeep Gopalpet <Sandeep.Kumar@freescale.com>
> +
> + for (i = 0; i < priv->num_tx_queues; i++) {
> + txq = netdev_get_tx_queue(dev, i);
> + tx_bytes += txq->tx_bytes;
> + tx_packets += txq->tx_packets;
> + }
> +
> + dev->stats.tx_bytes = tx_bytes;
> + dev->stats.tx_packets = tx_packets;
> +
> + return &dev->stats;
Fine by me, but if this patch is for linux-2.6.33, you can use dev_txq_stats_fold()
helper in your gfar_get_stats()
dev_txq_stats_fold(dev, &dev->stats);
return &dev->stats;
next prev parent reply other threads:[~2009-12-10 6:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-10 5:42 [RFC] gianfar: Fix stats support Sandeep Gopalpet
2009-12-10 6:13 ` Eric Dumazet [this message]
2009-12-10 7:43 ` Kumar Gopalpet-B05799
2009-12-10 8:21 ` Eric Dumazet
2009-12-10 8:25 ` Eric Dumazet
2009-12-10 15:11 ` Anton Vorontsov
2009-12-11 4:50 ` Kumar Gopalpet-B05799
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=4B209173.7030304@gmail.com \
--to=eric.dumazet@gmail.com \
--cc=Sandeep.Kumar@freescale.com \
--cc=avorontsov@ru.mvista.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/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.