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:   Fri, 22 Nov 2019 15:21:37 -0800
From:   Stephen Hemminger <stephen@...workplumber.org>
To:     Vivien Didelot <vivien.didelot@...il.com>
Cc:     "David S. Miller" <davem@...emloft.net>,
        Roopa Prabhu <roopa@...ulusnetworks.com>,
        Nikolay Aleksandrov <nikolay@...ulusnetworks.com>,
        bridge@...ts.linux-foundation.org, netdev@...r.kernel.org,
        f.fainelli@...il.com
Subject: Re: [PATCH net-next] net: bridge: add STP stat counters

On Fri, 22 Nov 2019 18:07:42 -0500
Vivien Didelot <vivien.didelot@...il.com> wrote:

> This adds rx_bpdu, tx_bpdu, rx_tcn, tx_tcn, transition_blk,
> transition_fwd stat counters to the bridge ports, along with sysfs
> statistics nodes under a "statistics" directory of the "brport" entry,
> providing useful information for STP, for example:
> 
>     # cat /sys/class/net/lan0/brport/statistics/tx_bpdu
>     26
>     # cat /sys/class/net/lan5/brport/statistics/transition_fwd
>     3
> 
> At the same time, make BRPORT_ATTR define a non-const attribute as
> this is required by the attribute group structure.
> 
> Signed-off-by: Vivien Didelot <vivien.didelot@...il.com>

Please don't add more sysfs stuff. put it in netlink.

> ---
>  net/bridge/br_private.h  |  8 ++++++++
>  net/bridge/br_stp.c      |  8 ++++++++
>  net/bridge/br_stp_bpdu.c |  4 ++++
>  net/bridge/br_sysfs_if.c | 35 ++++++++++++++++++++++++++++++++++-
>  4 files changed, 54 insertions(+), 1 deletion(-)
> 
> diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
> index 36b0367ca1e0..360d8030e3b2 100644
> --- a/net/bridge/br_private.h
> +++ b/net/bridge/br_private.h
> @@ -283,6 +283,14 @@ struct net_bridge_port {
>  #endif
>  	u16				group_fwd_mask;
>  	u16				backup_redirected_cnt;
> +
> +	/* Statistics */
> +	atomic_long_t			rx_bpdu;
> +	atomic_long_t			tx_bpdu;
> +	atomic_long_t			rx_tcn;
> +	atomic_long_t			tx_tcn;
> +	atomic_long_t			transition_blk;
> +	atomic_long_t			transition_fwd;
>  };
>  

There is no these need to be atomic.
Atomic is expensive.

Powered by blists - more mailing lists