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: <20220309134341.6037bb1d@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date:   Wed, 9 Mar 2022 13:43:41 -0800
From:   Jakub Kicinski <kuba@...nel.org>
To:     Eric Dumazet <eric.dumazet@...il.com>
Cc:     "David S . Miller" <davem@...emloft.net>,
        netdev <netdev@...r.kernel.org>,
        Eric Dumazet <edumazet@...gle.com>,
        jeffreyji <jeffreyji@...gle.com>,
        Brian Vazquez <brianvv@...gle.com>
Subject: Re: [PATCH net-next] net: add per-cpu storage and net->core_stats

On Wed,  9 Mar 2022 13:18:08 -0800 Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@...gle.com>
> 
> Before adding yet another possibly contended atomic_long_t,
> it is time to add per-cpu storage for existing ones:
>  dev->tx_dropped, dev->rx_dropped, and dev->rx_nohandler
> 
> Because many devices do not have to increment such counters,
> allocate the per-cpu storage on demand, so that dev_get_stats()
> does not have to spend considerable time folding zero counters.
> 
> Note that some drivers have abused these counters which
> were supposed to be only used by core networking stack.
> 
> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> Cc: jeffreyji <jeffreyji@...gle.com>
> Cc: Brian Vazquez <brianvv@...gle.com>

Reviewed-by: Jakub Kicinski <kuba@...nel.org>

Things to mention in passing, in case there is a v2:
 - we could use a different header for this, netdevice.h is a monster
 - netdev_core_stats_alloc() could have the last if inverted to keep
   success path unindented

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ