All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Eric Dumazet' <eric.dumazet@gmail.com>,
	David Miller <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>, Tariq Toukan <tariqt@mellanox.com>
Subject: RE: [PATCH] mlx4: give precise rx/tx bytes/packets counters
Date: Fri, 25 Nov 2016 16:03:37 +0000	[thread overview]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6DB0228849@AcuExch.aculab.com> (raw)
In-Reply-To: <1480088780.8455.543.camel@edumazet-glaptop3.roam.corp.google.com>

From: Of Eric Dumazet
> Sent: 25 November 2016 15:46
> mlx4 stats are chaotic because a deferred work queue is responsible
> to update them every 250 ms.
> 
> Even sampling stats every one second with "sar -n DEV 1" gives
> variations like the following :
...
> This patch allows rx/tx bytes/packets counters being folded at the
> time we need stats.
> 
> We now can fetch stats every 1 ms if we want to check NIC behavior
> on a small time window. It is also easier to detect anomalies.
...
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Tariq Toukan <tariqt@mellanox.com>
...
>  	for (i = 0; i < priv->rx_ring_num; i++) {
> -		stats->rx_packets += priv->rx_ring[i]->packets;
> -		stats->rx_bytes += priv->rx_ring[i]->bytes;
> -		sw_rx_dropped += priv->rx_ring[i]->dropped;
> -		priv->port_stats.rx_chksum_good += priv->rx_ring[i]->csum_ok;
> -		priv->port_stats.rx_chksum_none += priv->rx_ring[i]->csum_none;
> -		priv->port_stats.rx_chksum_complete += priv->rx_ring[i]->csum_complete;
> -		priv->xdp_stats.rx_xdp_drop    += priv->rx_ring[i]->xdp_drop;
> -		priv->xdp_stats.rx_xdp_tx      += priv->rx_ring[i]->xdp_tx;
> -		priv->xdp_stats.rx_xdp_tx_full += priv->rx_ring[i]->xdp_tx_full;
> +		const struct mlx4_en_rx_ring *ring = priv->rx_ring[i];
> +
> +		sw_rx_dropped			+= READ_ONCE(ring->dropped);
> +		priv->port_stats.rx_chksum_good += READ_ONCE(ring->csum_ok);
> +		priv->port_stats.rx_chksum_none += READ_ONCE(ring->csum_none);
> +		priv->port_stats.rx_chksum_complete += READ_ONCE(ring->csum_complete);
> +		priv->xdp_stats.rx_xdp_drop	+= READ_ONCE(ring->xdp_drop);
> +		priv->xdp_stats.rx_xdp_tx	+= READ_ONCE(ring->xdp_tx);
> +		priv->xdp_stats.rx_xdp_tx_full	+= READ_ONCE(ring->xdp_tx_full);

This chunk (and the one after) seem to be adding READ_ONCE() and don't
seem to be related to the commit message.

	David


  reply	other threads:[~2016-11-25 16:04 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-25 15:46 [PATCH] mlx4: give precise rx/tx bytes/packets counters Eric Dumazet
2016-11-25 16:03 ` David Laight [this message]
2016-11-25 16:16   ` Eric Dumazet
2016-11-25 16:30     ` Aw: " Lino Sanfilippo
2016-11-25 19:19       ` Eric Dumazet
2016-11-28 22:02         ` Lino Sanfilippo
2016-11-29  0:19           ` Eric Dumazet
2016-11-30 15:28             ` David Laight
2016-11-30 15:47               ` Eric Dumazet
2016-11-26 22:47 ` Saeed Mahameed
2016-11-27  2:16   ` Eric Dumazet
2016-11-28 20:40     ` David Miller
2016-11-28 21:55       ` Saeed Mahameed
2016-11-28 22:57         ` Eric Dumazet
2016-11-29 18:37 ` David Miller
2016-11-30 14:08 ` Regression: " Jesper Dangaard Brouer
2016-11-30 15:58   ` Eric Dumazet
2016-11-30 16:46     ` Saeed Mahameed
2016-11-30 17:35       ` Eric Dumazet
2016-11-30 20:42         ` Saeed Mahameed
2016-11-30 21:00           ` Eric Dumazet
2016-12-01 12:37             ` Jesper Dangaard Brouer
2016-12-01 13:02               ` [PATCH net-next] mlx4: fix use-after-free in mlx4_en_fold_software_stats() Eric Dumazet
2016-12-01 15:23                 ` Saeed Mahameed
2016-12-02 18:36                 ` David Miller
2016-12-01 15:38             ` Regression: [PATCH] mlx4: give precise rx/tx bytes/packets counters Saeed Mahameed
2016-12-01 15:55               ` Eric Dumazet
2016-12-01 16:08                 ` Eric Dumazet
2016-12-01 17:36                   ` Eric Dumazet
2016-12-04 13:23                     ` Saeed Mahameed
2016-12-01 16:33                 ` Saeed Mahameed
2016-12-01 17:08                   ` Eric Dumazet
2016-12-04 13:21                     ` Saeed Mahameed

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=063D6719AE5E284EB5DD2968C1650D6DB0228849@AcuExch.aculab.com \
    --to=david.laight@aculab.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=tariqt@mellanox.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.