linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Esben Haabendal <esben@geanix.com>
To: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Claudiu Manoil <claudiu.manoil@nxp.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH 2/6] net: gianfar: Extend statistics counters to 64-bit
Date: Thu, 17 Jun 2021 11:49:17 +0200	[thread overview]
Message-ID: <c4536afc2cef56eec435103dcb303021f1e6f557.1623922686.git.esben@geanix.com> (raw)
In-Reply-To: <cover.1623922686.git.esben@geanix.com>

No reason to wrap counter values at 2^32.  Especially the bytes counters
can wrap pretty fast on Gbit networks.

Signed-off-by: Esben Haabendal <esben@geanix.com>
---
 drivers/net/ethernet/freescale/gianfar.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/freescale/gianfar.h b/drivers/net/ethernet/freescale/gianfar.h
index 5ea47df93e5e..d8ae5353e881 100644
--- a/drivers/net/ethernet/freescale/gianfar.h
+++ b/drivers/net/ethernet/freescale/gianfar.h
@@ -913,8 +913,8 @@ enum {
  * Per TX queue stats
  */
 struct tx_q_stats {
-	unsigned long tx_packets;
-	unsigned long tx_bytes;
+	u64 tx_packets;
+	u64 tx_bytes;
 };
 
 /**
@@ -963,9 +963,9 @@ struct gfar_priv_tx_q {
  * Per RX queue stats
  */
 struct rx_q_stats {
-	unsigned long rx_packets;
-	unsigned long rx_bytes;
-	unsigned long rx_dropped;
+	u64 rx_packets;
+	u64 rx_bytes;
+	u64 rx_dropped;
 };
 
 struct gfar_rx_buff {
-- 
2.32.0


  parent reply	other threads:[~2021-06-17  9:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-17  9:49 [PATCH 0/6] net: gianfar: 64-bit statistics and rx_missed_errors counter Esben Haabendal
2021-06-17  9:49 ` [PATCH 1/6] net: gianfar: Convert to ndo_get_stats64 interface Esben Haabendal
2021-06-17  9:49 ` Esben Haabendal [this message]
2021-06-17  9:49 ` [PATCH 3/6] net: gianfar: Clear CAR registers Esben Haabendal
2021-06-17  9:49 ` [PATCH 4/6] net: gianfar: Avoid 16 bytes of memset Esben Haabendal
2021-06-17  9:49 ` [PATCH 5/6] net: gianfar: Add definitions for CAR1 and CAM1 register bits Esben Haabendal
2021-06-17  9:49 ` [PATCH 6/6] net: gianfar: Implement rx_missed_errors counter Esben Haabendal
2021-06-17 19:20 ` [PATCH 0/6] net: gianfar: 64-bit statistics and " patchwork-bot+netdevbpf

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=c4536afc2cef56eec435103dcb303021f1e6f557.1623922686.git.esben@geanix.com \
    --to=esben@geanix.com \
    --cc=claudiu.manoil@nxp.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=netdev@vger.kernel.org \
    --subject='Re: [PATCH 2/6] net: gianfar: Extend statistics counters to 64-bit' \
    /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

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).