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]
Message-ID: <20240104125352.5f8ef6ce@kernel.org>
Date: Thu, 4 Jan 2024 12:53:52 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Shinas Rasheed <srasheed@...vell.com>
Cc: <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
 <hgani@...vell.com>, <vimleshk@...vell.com>, <sedara@...vell.com>,
 <egallen@...hat.com>, <mschmidt@...hat.com>, <pabeni@...hat.com>,
 <horms@...nel.org>, <wizhao@...hat.com>, <kheib@...hat.com>,
 <konguyen@...hat.com>, Veerasenareddy Burru <vburru@...vell.com>, Satananda
 Burla <sburla@...vell.com>, "David S. Miller" <davem@...emloft.net>, Eric
 Dumazet <edumazet@...gle.com>
Subject: Re: [PATCH net-next v2 7/8] octeon_ep_vf: add ethtool support

On Sat, 23 Dec 2023 05:39:59 -0800 Shinas Rasheed wrote:
> +	rx_packets = 0;
> +	rx_bytes = 0;
> +	tx_packets = 0;
> +	tx_bytes = 0;
> +	rx_alloc_errors = 0;
> +	tx_busy_errors = 0;
> +	tx_packets = 0;
> +	tx_bytes = 0;
> +	rx_packets = 0;
> +	rx_bytes = 0;
> +
> +	octep_vf_get_if_stats(oct);
> +	iface_tx_stats = &oct->iface_tx_stats;
> +	iface_rx_stats = &oct->iface_rx_stats;
> +
> +	for (q = 0; q < oct->num_oqs; q++) {
> +		struct octep_vf_iq *iq = oct->iq[q];
> +		struct octep_vf_oq *oq = oct->oq[q];
> +
> +		tx_packets += iq->stats.instr_completed;
> +		tx_bytes += iq->stats.bytes_sent;
> +		tx_busy_errors += iq->stats.tx_busy;
> +
> +		rx_packets += oq->stats.packets;
> +		rx_bytes += oq->stats.bytes;
> +		rx_alloc_errors += oq->stats.alloc_failures;
> +	}
> +	i = 0;
> +	data[i++] = rx_packets;
> +	data[i++] = tx_packets;
> +	data[i++] = rx_bytes;
> +	data[i++] = tx_bytes;
> +	data[i++] = rx_alloc_errors;
> +	data[i++] = tx_busy_errors;

Don't duplicate stats you're already reporting via ndo_get_stats64,
please.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ