lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 10 Dec 2009 07:13:07 +0100
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Sandeep Gopalpet <Sandeep.Kumar@...escale.com>
CC:	netdev@...r.kernel.org, avorontsov@...mvista.com,
	davem@...emloft.net
Subject: Re: [RFC] gianfar: Fix stats support

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@...escale.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;

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ