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: <a2b53c79-2700-05a2-b090-a61fdb3da2b2@linux-m68k.org>
Date:   Thu, 23 Mar 2017 21:43:00 +1000
From:   Greg Ungerer <gerg@...ux-m68k.org>
To:     Bjørn Mork <bjorn@...k.no>
Cc:     oneukum@...e.com, netdev@...r.kernel.org, linux-usb@...r.kernel.org
Subject: Re: [PATCH] net: usbnet: support 64bit stats in qmi_wwan driver

Hi Bjorn,

On 23/03/17 18:33, Bjørn Mork wrote:
> Greg Ungerer <gerg@...ux-m68k.org> writes:
>
>> Add support for the net stats64 counters to the usbnet core and then to
>> the qmi_wwan driver.
>>
>> This is a strait forward addition of 64bit counters for RX and TX packets
>> and byte counts. It is done in the same style as for the other net drivers
>> that support stats64.
>>
>> The bulk of the change is to the usbnet core. Then it is trivial to use
>> that in the qmi_wwan.c driver. It would be very simple to extend this
>> support to other usbnet based drivers.
>>
>> The motivation to add this is that it is not particularly difficult to
>> get the RX and TX byte counts to wrap on 32bit platforms.
>
> You must have a higher quota than me :)

Well, not me personally :-)


> But the patch does not apply to current net-next du to a conflict with
> the ethtool_{get|set}_link_ksettings changes.

Ok, will respin against net-next. I generated this against 4.11-rc2.


>> +void usbnet_get_stats64(struct net_device *net, struct rtnl_link_stats64 *stats)
>> +{
>> +	struct usbnet *dev = netdev_priv(net);
>> +	unsigned int start;
>> +
>> +	netdev_stats_to_stats64(stats, &net->stats);
>> +
>> +	do {
>> +		start = u64_stats_fetch_begin_irq(&dev->stats.syncp);
>> +		stats->rx_packets = dev->stats.rx_packets;
>> +		stats->rx_bytes = dev->stats.rx_bytes;
>> +		stats->tx_packets = dev->stats.tx_packets;
>> +		stats->tx_bytes = dev->stats.tx_bytes;
>> +	} while (u64_stats_fetch_retry_irq(&dev->stats.syncp, start));
>> +}
>> +
>
> And I believe EXPORT_SYMBOL is missing here?

Yep, will fix that too. Thanks.

Regards
Greg


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ