From: David Decotigny <david.decotigny@google.com>
To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
Ian Campbell <ian.campbell@citrix.com>,
Eric Dumazet <eric.dumazet@gmail.com>,
Jeff Kirsher <jeffrey.t.kirsher@intel.com>,
Ben Hutchings <bhutchings@solarflare.com>,
Jiri Pirko <jpirko@redhat.com>, Joe Perches <joe@perches.com>,
Szymon Janc <szymon@janc.net.pl>,
David Decotigny <david.decotigny@google.com>
Subject: [PATCH net-next v2 05/10] forcedeth: stats for rx_packets based on hardware registers
Date: Thu, 10 Nov 2011 17:31:30 -0800 [thread overview]
Message-ID: <5a426eed778ea6dbe314c8d5932fb09f4e98dd8b.1320974990.git.david.decotigny@google.com> (raw)
In-Reply-To: <cover.1320974990.git.david.decotigny@google.com>
In-Reply-To: <cover.1320974990.git.david.decotigny@google.com>
Use the hardware registers instead of a software implementation to
account for the number of RX packets.
Signed-off-by: David Decotigny <david.decotigny@google.com>
---
drivers/net/ethernet/nvidia/forcedeth.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c
index 10d1e37..1a1972b 100644
--- a/drivers/net/ethernet/nvidia/forcedeth.c
+++ b/drivers/net/ethernet/nvidia/forcedeth.c
@@ -1722,6 +1722,7 @@ static struct net_device_stats *nv_get_stats(struct net_device *dev)
dev->stats.tx_packets = np->estats.tx_packets;
dev->stats.rx_bytes = np->estats.rx_bytes;
}
+ dev->stats.rx_packets = np->estats.rx_packets;
dev->stats.tx_bytes = np->estats.tx_bytes;
dev->stats.tx_fifo_errors = np->estats.tx_fifo_errors;
dev->stats.tx_carrier_errors = np->estats.tx_carrier_errors;
@@ -2709,7 +2710,6 @@ static int nv_rx_process(struct net_device *dev, int limit)
skb_put(skb, len);
skb->protocol = eth_type_trans(skb, dev);
napi_gro_receive(&np->napi, skb);
- dev->stats.rx_packets++;
if (unlikely(!(np->driver_data & DEV_HAS_STATISTICS_V23)))
dev->stats.rx_bytes += len;
next_pkt:
@@ -2794,7 +2794,6 @@ static int nv_rx_process_optimized(struct net_device *dev, int limit)
__vlan_hwaccel_put_tag(skb, vid);
}
napi_gro_receive(&np->napi, skb);
- dev->stats.rx_packets++;
if (unlikely(!(np->driver_data
& DEV_HAS_STATISTICS_V23)))
dev->stats.rx_bytes += len;
--
1.7.3.1
next prev parent reply other threads:[~2011-11-11 1:40 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-11 1:31 [PATCH net-next v2 00/10] forcedeth: stats & debug enhancements David Decotigny
2011-11-11 1:31 ` [PATCH net-next v2 01/10] forcedeth: fix ifconfig stats on hardware without extended stats support David Decotigny
2011-11-11 1:31 ` [PATCH net-next v2 02/10] forcedeth: Add messages to indicate using MSI or MSI-X David Decotigny
2011-11-11 1:31 ` [PATCH net-next v2 03/10] forcedeth: allow to silence "TX timeout" debug messages David Decotigny
2011-11-11 1:31 ` [PATCH net-next v2 04/10] forcedeth: expose module parameters in /sys/module David Decotigny
2011-11-11 1:31 ` David Decotigny [this message]
2011-11-11 1:31 ` [PATCH net-next v2 06/10] forcedeth: implement ndo_get_stats64() API David Decotigny
2011-11-11 1:31 ` [PATCH net-next v2 07/10] forcedeth: account for dropped RX frames David Decotigny
2011-11-11 1:31 ` [PATCH net-next v2 08/10] forcedeth: new ethtool stat counter for TX timeouts David Decotigny
2011-11-11 1:31 ` [PATCH net-next v2 09/10] forcedeth: stats updated with a deferrable timer David Decotigny
2011-11-11 1:31 ` [PATCH net-next v2 10/10] forcedeth: whitespace/indentation fixes David Decotigny
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=5a426eed778ea6dbe314c8d5932fb09f4e98dd8b.1320974990.git.david.decotigny@google.com \
--to=david.decotigny@google.com \
--cc=bhutchings@solarflare.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=ian.campbell@citrix.com \
--cc=jeffrey.t.kirsher@intel.com \
--cc=joe@perches.com \
--cc=jpirko@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=szymon@janc.net.pl \
/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
all inboxes | Powered by JetHome®