xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: Mart van Santen <mart@greenhost.nl>, xen-devel@lists.xen.org
Subject: Re: [BUG]: [PATCH added] Incorrect queue counters in netback interface
Date: Fri, 23 Dec 2016 16:38:43 +0100	[thread overview]
Message-ID: <fe2d6e05-9ff4-6ee4-7948-c1d1de18e364@suse.com> (raw)
In-Reply-To: <585D338C.5020905@greenhost.nl>

On 23/12/16 15:24, Mart van Santen wrote:
> Hello Xen Devel,
> 
> We encountered an issue with one of our instances pushing a lot of
> (network) data, resulting in incorrect bandwidth reporting. We do poll
> interface traffic every 5 minutes for every interface of our instances
> (from Dom0) and store those values for reporting/graphing. At some point
> we discovered reports of machines pushing a lot of data, were incorrect
> and were going down in chucks of about 4 GB, while you expect this is an
> always increasing number (or wraps around a 32 or 64 bit counter)
> 
> After futher analysing the problem and the source code we discovered
> that the counters of the queues in the code are handled as 32-bit
> integers, while the total bytes tx/rx for the while interface are
> counted as 64-bit longs.
> 
> 
> Attached a patch to solve the problem.

...

> --- a/drivers/net/xen-netback/common.h	2016-12-22 15:41:07.785535748 +0000
> +++ b/drivers/net/xen-netback/common.h	2016-12-23 13:08:18.123080064 +0000
> @@ -119,10 +119,10 @@
>  	 * A subset of struct net_device_stats that contains only the
>  	 * fields that are updated in netback.c for each queue.
>  	 */
> -	unsigned int rx_bytes;
> -	unsigned int rx_packets;
> -	unsigned int tx_bytes;
> -	unsigned int tx_packets;
> +	unsigned long rx_bytes;
> +	unsigned long rx_packets;
> +	unsigned long tx_bytes;
> +	unsigned long tx_packets;

So on 32 bit kernels you'll still encounter the same problem.

Please use the type "u64" as (nearly) everywhere else.

You might want to read Documentation/SubmittingPatches in the Linux
kernel source tree.


Juergen

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

      reply	other threads:[~2016-12-23 15:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-23 14:24 [BUG]: [PATCH added] Incorrect queue counters in netback interface Mart van Santen
2016-12-23 15:38 ` Juergen Gross [this message]

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=fe2d6e05-9ff4-6ee4-7948-c1d1de18e364@suse.com \
    --to=jgross@suse.com \
    --cc=mart@greenhost.nl \
    --cc=xen-devel@lists.xen.org \
    /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).