netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Durrant <Paul.Durrant@citrix.com>
To: 'Mart van Santen' <mart@greenhost.nl>,
	Wei Liu <wei.liu2@citrix.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH] xen-netback: vif counters from int/long to u64
Date: Fri, 10 Feb 2017 12:49:47 +0000	[thread overview]
Message-ID: <2877c83e45a444e1b39f0da1e5adb86b@AMSPEX02CL03.citrite.net> (raw)
In-Reply-To: <1486728138-13253-1-git-send-email-mart@greenhost.nl>

> -----Original Message-----
> From: Xen-devel [mailto:xen-devel-bounces@lists.xen.org] On Behalf Of
> Mart van Santen
> Sent: 10 February 2017 12:02
> To: Wei Liu <wei.liu2@citrix.com>; Paul Durrant <Paul.Durrant@citrix.com>;
> xen-devel@lists.xenproject.org; netdev@vger.kernel.org
> Cc: Mart van Santen <mart@greenhost.nl>
> Subject: [Xen-devel] [PATCH] xen-netback: vif counters from int/long to u64
> 
> This patch fixes an issue where the type of counters in the queue(s)
> and interface are not in sync (queue counters are int, interface
> counters are long), causing incorrect reporting of tx/rx values
> of the vif interface and unclear counter overflows.
> This patch sets both counters to the u64 type.
> 
> Signed-off-by: Mart van Santen <mart@greenhost.nl>

Looks sensible to me.

Reviewed-by: Paul Durrant <paul.durrant@citrix.com>

> ---
>  drivers/net/xen-netback/common.h    | 8 ++++----
>  drivers/net/xen-netback/interface.c | 8 ++++----
>  2 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-
> netback/common.h
> index 3ce1f7d..530586b 100644
> --- a/drivers/net/xen-netback/common.h
> +++ b/drivers/net/xen-netback/common.h
> @@ -113,10 +113,10 @@ struct xenvif_stats {
>  	 * 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;
> +	u64 rx_bytes;
> +	u64 rx_packets;
> +	u64 tx_bytes;
> +	u64 tx_packets;
> 
>  	/* Additional stats used by xenvif */
>  	unsigned long rx_gso_checksum_fixup;
> diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-
> netback/interface.c
> index 5795213..50fa169 100644
> --- a/drivers/net/xen-netback/interface.c
> +++ b/drivers/net/xen-netback/interface.c
> @@ -221,10 +221,10 @@ static struct net_device_stats
> *xenvif_get_stats(struct net_device *dev)
>  {
>  	struct xenvif *vif = netdev_priv(dev);
>  	struct xenvif_queue *queue = NULL;
> -	unsigned long rx_bytes = 0;
> -	unsigned long rx_packets = 0;
> -	unsigned long tx_bytes = 0;
> -	unsigned long tx_packets = 0;
> +	u64 rx_bytes = 0;
> +	u64 rx_packets = 0;
> +	u64 tx_bytes = 0;
> +	u64 tx_packets = 0;
>  	unsigned int index;
> 
>  	spin_lock(&vif->lock);
> --
> 2.1.4
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> https://lists.xen.org/xen-devel
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

      reply	other threads:[~2017-02-10 12:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-10 12:02 [PATCH] xen-netback: vif counters from int/long to u64 Mart van Santen
2017-02-10 12:49 ` Paul Durrant [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=2877c83e45a444e1b39f0da1e5adb86b@AMSPEX02CL03.citrite.net \
    --to=paul.durrant@citrix.com \
    --cc=mart@greenhost.nl \
    --cc=netdev@vger.kernel.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.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).