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] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 16 Mar 2016 17:16:30 +0300
From:	Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To:	Woojung.Huh@...rochip.com, davem@...emloft.net,
	netdev@...r.kernel.org
Cc:	UNGLinuxDriver@...rochip.com
Subject: Re: [PATCH 2/2] lan78xx: add ndo_get_stats64

Hello.

On 3/16/2016 1:52 AM, Woojung.Huh@...rochip.com wrote:

> From: Woojung Huh <woojung.huh@...rochip.com>
>
> Add lan78xx_get_stats64 of ndo_get_stats64 to report
> all statistics counters including errors from HW statistics.
>
> Read from HW when auto suspend is disabled, use saved counter when
> auto suspend is enabled because periodic call to ndo_get_stats64
> prevents USB auto suspend.
>
> Signed-off-by: Woojung Huh <woojung.huh@...rochip.com>
> ---
>   drivers/net/usb/lan78xx.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++
>   1 file changed, 49 insertions(+)
>
> diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c
> index f20890e..f4a9708f 100644
> --- a/drivers/net/usb/lan78xx.c
> +++ b/drivers/net/usb/lan78xx.c
> @@ -3261,6 +3261,54 @@ void lan78xx_tx_timeout(struct net_device *net)
>   	tasklet_schedule(&dev->bh);
>   }
>
> +struct rtnl_link_stats64 *lan78xx_get_stats64(struct net_device *netdev,
> +					      struct rtnl_link_stats64 *storage)
> +{
[...]
> +	storage->rx_length_errors = (stats.rx_undersize_frame_errors +
> +				     stats.rx_oversize_frame_errors);

    Parens not needed.

> +	storage->rx_crc_errors = stats.rx_fcs_errors;
> +	storage->rx_frame_errors = stats.rx_alignment_errors;
> +	storage->rx_fifo_errors = stats.rx_dropped_frames;
> +	storage->rx_over_errors = stats.rx_oversize_frame_errors;
> +	storage->rx_errors = (stats.rx_fcs_errors +
> +			      stats.rx_alignment_errors +
> +			      stats.rx_fragment_errors +
> +			      stats.rx_jabber_errors +
> +			      stats.rx_undersize_frame_errors +
> +			      stats.rx_oversize_frame_errors +
> +			      stats.rx_dropped_frames);

    Neither here.

> +
> +	storage->tx_carrier_errors = stats.tx_carrier_errors;
> +	storage->tx_errors = (stats.tx_fcs_errors +
> +			      stats.tx_excess_deferral_errors +
> +			      stats.tx_carrier_errors);

    And here.

[...]

MBR, Sergei

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ