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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250115142307.35840bae@kernel.org>
Date: Wed, 15 Jan 2025 14:23:07 -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>, <sedara@...vell.com>, <vimleshk@...vell.com>,
 <thaller@...hat.com>, <wizhao@...hat.com>, <kheib@...hat.com>,
 <konguyen@...hat.com>, <horms@...nel.org>, <einstein.xue@...axg.com>,
 Veerasenareddy Burru <vburru@...vell.com>, Andrew Lunn
 <andrew+netdev@...n.ch>, "David S. Miller" <davem@...emloft.net>, Eric
 Dumazet <edumazet@...gle.com>, "Paolo Abeni" <pabeni@...hat.com>
Subject: Re: [PATCH net v7 1/4] octeon_ep: update tx/rx stats locally for
 persistence

On Tue, 14 Jan 2025 04:51:21 -0800 Shinas Rasheed wrote:
> +	tx_packets = 0;
> +	tx_bytes = 0;
> +	rx_packets = 0;
> +	rx_bytes = 0;
> +	for (q = 0; q < oct->num_ioq_stats; q++) {
> +		tx_packets += oct->stats_iq[q].instr_completed;
> +		tx_bytes += oct->stats_iq[q].bytes_sent;
> +		rx_packets += oct->stats_oq[q].packets;
> +		rx_bytes += oct->stats_oq[q].bytes;
> +	}
> +
>  	if (netif_running(netdev))
>  		octep_ctrl_net_get_if_stats(oct,
>  					    OCTEP_CTRL_NET_INVALID_VFID,
>  					    &oct->iface_rx_stats,
>  					    &oct->iface_tx_stats);
>  
> -	tx_packets = 0;
> -	tx_bytes = 0;
> -	rx_packets = 0;
> -	rx_bytes = 0;
> -	for (q = 0; q < oct->num_oqs; q++) {
> -		struct octep_iq *iq = oct->iq[q];
> -		struct octep_oq *oq = oct->oq[q];
> -
> -		tx_packets += iq->stats.instr_completed;
> -		tx_bytes += iq->stats.bytes_sent;
> -		rx_packets += oq->stats.packets;
> -		rx_bytes += oq->stats.bytes;
> -	}

This code move is unnecessary. Next patch removes the
octep_ctrl_net_get_if_stats() call, so you can just 
reorder the patches to remove the FW calls first, 
and the diff will be smaller here.
-- 
pw-bot: cr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ