netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Bjørn Mork" <bjorn@mork.no>
To: Greg Ungerer <gerg@linux-m68k.org>
Cc: oneukum@suse.com, netdev@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: [PATCH] net: usbnet: support 64bit stats in qmi_wwan driver
Date: Thu, 23 Mar 2017 09:33:23 +0100	[thread overview]
Message-ID: <87zigcz92k.fsf@miraculix.mork.no> (raw)
In-Reply-To: <1490232332-19274-1-git-send-email-gerg@linux-m68k.org> (Greg Ungerer's message of "Thu, 23 Mar 2017 11:25:32 +1000")

Greg Ungerer <gerg@linux-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 :)

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


> +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?



Bjørn

  reply	other threads:[~2017-03-23  8:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-23  1:25 [PATCH] net: usbnet: support 64bit stats in qmi_wwan driver Greg Ungerer
2017-03-23  8:33 ` Bjørn Mork [this message]
2017-03-23 11:43   ` Greg Ungerer
2017-03-23  8:46 ` Oliver Neukum
2017-03-23 11:43   ` Greg Ungerer
2017-03-23 11:25 ` kbuild test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zigcz92k.fsf@miraculix.mork.no \
    --to=bjorn@mork.no \
    --cc=gerg@linux-m68k.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=oneukum@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).