Skip to contentSkip to conversation

e1000e: convert to stats64

PATCH Superseded Flavio Leitner 3 participants 10 messages Dec 14, 2010 – Jan 21, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 e1000e: convert to stats64

Provides accurate stats at the time user reads them.

---
 drivers/net/e1000e/e1000.h   |    5 ++-
 drivers/net/e1000e/ethtool.c |   27 +++++++++-------
 drivers/net/e1000e/netdev.c  |   68 ++++++++++++++++++++++++-----------------
 3 files changed, 59 insertions(+), 41 deletions(-)
drivers/net/e1000e/e1000.h +4 -1
index fdc67fe..5a5e944 100644
@@ -363,6 +363,8 @@ struct e1000_adapter {
 	/* structs defined in e1000_hw.h */
 	struct e1000_hw hw;
 
+	spinlock_t stats64_lock;
+	struct rtnl_link_stats64 stats64;
 	struct e1000_hw_stats stats;
 	struct e1000_phy_info phy_info;
 	struct e1000_phy_stats phy_stats;
@@ -492,7 +494,8 @@ extern int e1000e_setup_rx_resources(struct e1000_adapter *adapter);
 extern int e1000e_setup_tx_resources(struct e1000_adapter *adapter);
 extern void e1000e_free_rx_resources(struct e1000_adapter *adapter);
 extern void e1000e_free_tx_resources(struct e1000_adapter *adapter);
-extern void e1000e_update_stats(struct e1000_adapter *adapter);
+extern void e1000e_update_stats(struct e1000_adapter *adapter,
+				struct rtnl_link_stats64 *net_stats);
 extern void e1000e_set_interrupt_capability(struct e1000_adapter *adapter);
 extern void e1000e_reset_interrupt_capability(struct e1000_adapter *adapter);
 extern void e1000e_disable_aspm(struct pci_dev *pdev, u16 state);
drivers/net/e1000e/ethtool.c +15 -12
index 8984d16..07e4d7c 100644
@@ -49,8 +49,8 @@ struct e1000_stats {
 				sizeof(((struct e1000_adapter *)0)->m), \
 		      		offsetof(struct e1000_adapter, m)
 #define E1000_NETDEV_STAT(m)	NETDEV_STATS, \
-				sizeof(((struct net_device *)0)->m), \
-				offsetof(struct net_device, m)
+				sizeof(((struct rtnl_link_stats64 *)0)->m), \
+				offsetof(struct rtnl_link_stats64, m)
 
 static const struct e1000_stats e1000_gstrings_stats[] = {
 	{ "rx_packets", E1000_STAT(stats.gprc) },
@@ -61,21 +61,21 @@ static const struct e1000_stats e1000_gstrings_stats[] = {
 	{ "tx_broadcast", E1000_STAT(stats.bptc) },
 	{ "rx_multicast", E1000_STAT(stats.mprc) },
 	{ "tx_multicast", E1000_STAT(stats.mptc) },
-	{ "rx_errors", E1000_NETDEV_STAT(stats.rx_errors) },
-	{ "tx_errors", E1000_NETDEV_STAT(stats.tx_errors) },
-	{ "tx_dropped", E1000_NETDEV_STAT(stats.tx_dropped) },
+	{ "rx_errors", E1000_NETDEV_STAT(rx_errors) },
+	{ "tx_errors", E1000_NETDEV_STAT(tx_errors) },
+	{ "tx_dropped", E1000_NETDEV_STAT(tx_dropped) },
 	{ "multicast", E1000_STAT(stats.mprc) },
 	{ "collisions", E1000_STAT(stats.colc) },
-	{ "rx_length_errors", E1000_NETDEV_STAT(stats.rx_length_errors) },
-	{ "rx_over_errors", E1000_NETDEV_STAT(stats.rx_over_errors) },
+	{ "rx_length_errors", E1000_NETDEV_STAT(rx_length_errors) },
+	{ "rx_over_errors", E1000_NETDEV_STAT(rx_over_errors) },
 	{ "rx_crc_errors", E1000_STAT(stats.crcerrs) },
-	{ "rx_frame_errors", E1000_NETDEV_STAT(stats.rx_frame_errors) },
+	{ "rx_frame_errors", E1000_NETDEV_STAT(rx_frame_errors) },
 	{ "rx_no_buffer_count", E1000_STAT(stats.rnbc) },
 	{ "rx_missed_errors", E1000_STAT(stats.mpc) },
 	{ "tx_aborted_errors", E1000_STAT(stats.ecol) },
 	{ "tx_carrier_errors", E1000_STAT(stats.tncrs) },
-	{ "tx_fifo_errors", E1000_NETDEV_STAT(stats.tx_fifo_errors) },
-	{ "tx_heartbeat_errors", E1000_NETDEV_STAT(stats.tx_heartbeat_errors) },
+	{ "tx_fifo_errors", E1000_NETDEV_STAT(tx_fifo_errors) },
+	{ "tx_heartbeat_errors", E1000_NETDEV_STAT(tx_heartbeat_errors) },
 	{ "tx_window_errors", E1000_STAT(stats.latecol) },
 	{ "tx_abort_late_coll", E1000_STAT(stats.latecol) },
 	{ "tx_deferred_ok", E1000_STAT(stats.dc) },
@@ -1972,14 +1972,16 @@ static void e1000_get_ethtool_stats(struct net_device *netdev,
 				    u64 *data)
 {
 	struct e1000_adapter *adapter = netdev_priv(netdev);
+	struct rtnl_link_stats64 *net_stats = &adapter->stats64;
 	int i;
 	char *p = NULL;
 
-	e1000e_update_stats(adapter);
+	spin_lock(&adapter->stats64_lock);
+	e1000e_update_stats(adapter, net_stats);
 	for (i = 0; i < E1000_GLOBAL_STATS_LEN; i++) {
 		switch (e1000_gstrings_stats[i].type) {
 		case NETDEV_STATS:
-			p = (char *) netdev +
+			p = (char *) net_stats +
 					e1000_gstrings_stats[i].stat_offset;
 			break;
 		case E1000_STATS:
@@ -1991,6 +1993,7 @@ static void e1000_get_ethtool_stats(struct net_device *netdev,
 		data[i] = (e1000_gstrings_stats[i].sizeof_stat ==
 			sizeof(u64)) ? *(u64 *)p : *(u32 *)p;
 	}
+	spin_unlock(&adapter->stats64_lock);
 }
 
 static void e1000_get_strings(struct net_device *netdev, u32 stringset,
drivers/net/e1000e/netdev.c +40 -28

153 lines not on this page · raw message

Signature · 1 line
1.7.3.1
#1 lore raw
Quoted 14 lines · Flavio Leitner

Provides accurate stats at the time user reads them.

---
 drivers/net/e1000e/e1000.h   |    5 ++-
 drivers/net/e1000e/ethtool.c |   27 +++++++++-------
 drivers/net/e1000e/netdev.c  |   68 ++++++++++++++++++++++++-----------------
 3 files changed, 59 insertions(+), 41 deletions(-)
drivers/net/e1000e/e1000.h +0 -0
index fdc67fe..5a5e944 100644

drivers/net/e1000e/e1000.h struct e1000_adapter { · line 367

Quoted 5 lines
drivers/net/e1000e/e1000.h +2 -0
@@ -363,6 +363,8 @@ struct e1000_adapter {
 	/* structs defined in e1000_hw.h */
 	struct e1000_hw hw;
 
+	spinlock_t stats64_lock;
+	struct rtnl_link_stats64 stats64;

I am not sure why you add this stats64 in e1000_adapter ?

Why isnt it provided by callers (automatic variable, or provided to ndo_get_stats64()). I dont see accumulators, only a full rewrite of this structure in e1000e_update_stats() ?

#2 lore raw

PATCH v2 1/1 e1000e: convert to stats64

Quoted 18 lines · Eric Dumazet
Quoted 17 lines · Flavio Leitner

Provides accurate stats at the time user reads them.

---
 drivers/net/e1000e/e1000.h   |    5 ++-
 drivers/net/e1000e/ethtool.c |   27 +++++++++-------
 drivers/net/e1000e/netdev.c  |   68 ++++++++++++++++++++++++-----------------
 3 files changed, 59 insertions(+), 41 deletions(-)
drivers/net/e1000e/e1000.h +0 -0
index fdc67fe..5a5e944 100644
@@ -363,6 +363,8 @@ struct e1000_adapter {
 	/* structs defined in e1000_hw.h */
 	struct e1000_hw hw;
 
Quoted 8 lines

drivers/net/e1000e/e1000.h struct e1000_adapter { · line 367

Quoted 2 lines
drivers/net/e1000e/e1000.h +2 -0
+	spinlock_t stats64_lock;
+	struct rtnl_link_stats64 stats64;

I am not sure why you add this stats64 in e1000_adapter ?

Why isnt it provided by callers (automatic variable, or provided to ndo_get_stats64()). I dont see accumulators, only a full rewrite of this structure in e1000e_update_stats() ?

Good point. I have modified the patch to fix that. thanks!

Quoted 1 line

From 3487bd7dacd0c23bba315270139dab6e00e5ff02 Mon Sep 17 00:00:00 2001

From: Flavio Leitner <[email protected]>
Date: Thu, 16 Dec 2010 10:26:03 -0200
Subject: [PATCH] e1000e: convert to stats64

Provides accurate stats at the time user reads them.

---
 drivers/net/e1000e/e1000.h   |    3 ++
 drivers/net/e1000e/ethtool.c |   25 ++++++++-------
 drivers/net/e1000e/netdev.c  |   68 +++++++++++++++++++++++++++++++++--------
 3 files changed, 70 insertions(+), 26 deletions(-)
drivers/net/e1000e/e1000.h +3 -0
index fdc67fe..d8fc3bc 100644
@@ -363,6 +363,7 @@ struct e1000_adapter {
 	/* structs defined in e1000_hw.h */
 	struct e1000_hw hw;
 
+	spinlock_t stats64_lock;
 	struct e1000_hw_stats stats;
 	struct e1000_phy_info phy_info;
 	struct e1000_phy_stats phy_stats;
@@ -493,6 +494,8 @@ extern int e1000e_setup_tx_resources(struct e1000_adapter *adapter);
 extern void e1000e_free_rx_resources(struct e1000_adapter *adapter);
 extern void e1000e_free_tx_resources(struct e1000_adapter *adapter);
 extern void e1000e_update_stats(struct e1000_adapter *adapter);
+extern struct rtnl_link_stats64 *e1000e_get_stats64(struct net_device *netdev,
+                                                   struct rtnl_link_stats64 *stats);
 extern void e1000e_set_interrupt_capability(struct e1000_adapter *adapter);
 extern void e1000e_reset_interrupt_capability(struct e1000_adapter *adapter);
 extern void e1000e_disable_aspm(struct pci_dev *pdev, u16 state);
drivers/net/e1000e/ethtool.c +13 -12
index 8984d16..f43b412 100644
@@ -49,8 +49,8 @@ struct e1000_stats {
 				sizeof(((struct e1000_adapter *)0)->m), \
 		      		offsetof(struct e1000_adapter, m)
 #define E1000_NETDEV_STAT(m)	NETDEV_STATS, \
-				sizeof(((struct net_device *)0)->m), \
-				offsetof(struct net_device, m)
+				sizeof(((struct rtnl_link_stats64 *)0)->m), \
+				offsetof(struct rtnl_link_stats64, m)
 
 static const struct e1000_stats e1000_gstrings_stats[] = {
 	{ "rx_packets", E1000_STAT(stats.gprc) },
@@ -61,21 +61,21 @@ static const struct e1000_stats e1000_gstrings_stats[] = {
 	{ "tx_broadcast", E1000_STAT(stats.bptc) },
 	{ "rx_multicast", E1000_STAT(stats.mprc) },
 	{ "tx_multicast", E1000_STAT(stats.mptc) },
-	{ "rx_errors", E1000_NETDEV_STAT(stats.rx_errors) },
-	{ "tx_errors", E1000_NETDEV_STAT(stats.tx_errors) },
-	{ "tx_dropped", E1000_NETDEV_STAT(stats.tx_dropped) },
+	{ "rx_errors", E1000_NETDEV_STAT(rx_errors) },
+	{ "tx_errors", E1000_NETDEV_STAT(tx_errors) },
+	{ "tx_dropped", E1000_NETDEV_STAT(tx_dropped) },
 	{ "multicast", E1000_STAT(stats.mprc) },
 	{ "collisions", E1000_STAT(stats.colc) },
-	{ "rx_length_errors", E1000_NETDEV_STAT(stats.rx_length_errors) },
-	{ "rx_over_errors", E1000_NETDEV_STAT(stats.rx_over_errors) },
+	{ "rx_length_errors", E1000_NETDEV_STAT(rx_length_errors) },
+	{ "rx_over_errors", E1000_NETDEV_STAT(rx_over_errors) },
 	{ "rx_crc_errors", E1000_STAT(stats.crcerrs) },
-	{ "rx_frame_errors", E1000_NETDEV_STAT(stats.rx_frame_errors) },
+	{ "rx_frame_errors", E1000_NETDEV_STAT(rx_frame_errors) },
 	{ "rx_no_buffer_count", E1000_STAT(stats.rnbc) },
 	{ "rx_missed_errors", E1000_STAT(stats.mpc) },
 	{ "tx_aborted_errors", E1000_STAT(stats.ecol) },
 	{ "tx_carrier_errors", E1000_STAT(stats.tncrs) },
-	{ "tx_fifo_errors", E1000_NETDEV_STAT(stats.tx_fifo_errors) },
-	{ "tx_heartbeat_errors", E1000_NETDEV_STAT(stats.tx_heartbeat_errors) },
+	{ "tx_fifo_errors", E1000_NETDEV_STAT(tx_fifo_errors) },
+	{ "tx_heartbeat_errors", E1000_NETDEV_STAT(tx_heartbeat_errors) },
 	{ "tx_window_errors", E1000_STAT(stats.latecol) },
 	{ "tx_abort_late_coll", E1000_STAT(stats.latecol) },
 	{ "tx_deferred_ok", E1000_STAT(stats.dc) },
@@ -1972,14 +1972,15 @@ static void e1000_get_ethtool_stats(struct net_device *netdev,
 				    u64 *data)
 {
 	struct e1000_adapter *adapter = netdev_priv(netdev);
+	struct rtnl_link_stats64 net_stats;
 	int i;
 	char *p = NULL;
 
-	e1000e_update_stats(adapter);
+	e1000e_get_stats64(netdev, &net_stats);
 	for (i = 0; i < E1000_GLOBAL_STATS_LEN; i++) {
 		switch (e1000_gstrings_stats[i].type) {
 		case NETDEV_STATS:
-			p = (char *) netdev +
+			p = (char *) &net_stats +
 					e1000_gstrings_stats[i].stat_offset;
 			break;
 		case E1000_STATS:
drivers/net/e1000e/netdev.c +54 -14

128 lines not on this page · raw message

Signature · 14 lines
1.7.3.1


------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
E1000-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit http://communities.intel.com/community/wired
#3 lore raw

drivers/net/e1000e/netdev.c static void e1000_reset_task(struct work_struct *work) · line 4906

Quoted 9 lines · Flavio Leitner
drivers/net/e1000e/netdev.c +5 -3
-static struct net_device_stats *e1000_get_stats(struct net_device *netdev)
+struct rtnl_link_stats64 *e1000e_get_stats64(struct net_device *netdev,
+						   struct rtnl_link_stats64 *stats)
 {
-	/* only return the current stats */
-	return &netdev->stats;
+	struct e1000_adapter *adapter = netdev_priv(netdev);
+
+	memset(stats, 0, sizeof(struct rtnl_link_stats64));

You dont need this memset(), stats is cleared by caller (dev_get_stats() in net/core/dev.c), as this was always done ;)

Quoted 10 lines
drivers/net/e1000e/netdev.c +10 -0
+	spin_lock(&adapter->stats64_lock);
+	e1000e_update_stats(adapter);
+	/* Fill out the OS statistics structure */
+	stats->rx_bytes = adapter->stats.gorc;
+	stats->rx_packets = adapter->stats.gprc;
+	stats->tx_bytes = adapter->stats.gotc;
+	stats->tx_packets = adapter->stats.gptc;
+	stats->multicast = adapter->stats.mprc;
+	stats->collisions = adapter->stats.colc;
+
#4 lore raw
Quoted 14 lines · Eric Dumazet

drivers/net/e1000e/netdev.c static void e1000_reset_task(struct work_struct *work) · line 4906

Quoted 9 lines · Flavio Leitner
drivers/net/e1000e/netdev.c +5 -3
-static struct net_device_stats *e1000_get_stats(struct net_device *netdev)
+struct rtnl_link_stats64 *e1000e_get_stats64(struct net_device *netdev,
+						   struct rtnl_link_stats64 *stats)
 {
-	/* only return the current stats */
-	return &netdev->stats;
+	struct e1000_adapter *adapter = netdev_priv(netdev);
+
+	memset(stats, 0, sizeof(struct rtnl_link_stats64));

You dont need this memset(), stats is cleared by caller (dev_get_stats() in net/core/dev.c), as this was always done ;)

Yes, but e1000_get_ethtool_stats() also calls it and doesn't do that. I could move the memset to the caller, but I thought it would be cleaner to leave where it is now.

Quoted 15 lines

drivers/net/e1000e/netdev.c static void e1000_reset_task(struct work_struct *work) · line 4916

Quoted 10 lines
drivers/net/e1000e/netdev.c +10 -0
+	spin_lock(&adapter->stats64_lock);
+	e1000e_update_stats(adapter);
+	/* Fill out the OS statistics structure */
+	stats->rx_bytes = adapter->stats.gorc;
+	stats->rx_packets = adapter->stats.gprc;
+	stats->tx_bytes = adapter->stats.gotc;
+	stats->tx_packets = adapter->stats.gptc;
+	stats->multicast = adapter->stats.mprc;
+	stats->collisions = adapter->stats.colc;
+

--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 13 lines
Flavio

------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
E1000-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit http://communities.intel.com/community/wired
Acked-by
#5 lore raw
Quoted 3 lines · Flavio Leitner

Yes, but e1000_get_ethtool_stats() also calls it and doesn't do that. I could move the memset to the caller, but I thought it would be cleaner to leave where it is now.

Yes, no problem !

#6 lore raw
In reply to Flavio Leitner
Quoted 36 lines · Flavio Leitner
Quoted 18 lines · Eric Dumazet
Quoted 17 lines · Flavio Leitner

Provides accurate stats at the time user reads them.

---
 drivers/net/e1000e/e1000.h   |    5 ++- drivers/net/e1000e/ethtool.c |   27 +++++++++------- drivers/net/e1000e/netdev.c  |   68 ++++++++++++++++++++++++-----------------

 3 files changed, 59 insertions(+), 41 deletions(-)
drivers/net/e1000e/e1000.h +0 -0
index fdc67fe..5a5e944 100644
@@ -363,6 +363,8 @@ struct e1000_adapter {
     /* structs defined in e1000_hw.h */
     struct e1000_hw hw;
 
Quoted 8 lines

drivers/net/e1000e/e1000.h struct e1000_adapter { · line 367

Quoted 2 lines
drivers/net/e1000e/e1000.h +2 -0
+   spinlock_t stats64_lock;
+   struct rtnl_link_stats64 stats64;

I am not sure why you add this stats64 in e1000_adapter ?

Why isnt it provided by callers (automatic variable, or provided to ndo_get_stats64()). I dont see accumulators, only a full rewrite of this structure in e1000e_update_stats() ?

Good point. I have modified the patch to fix that. thanks!

From 3487bd7dacd0c23bba315270139dab6e00e5ff02 Mon Sep 17 00:00:00 2001
From: Flavio Leitner <[email protected]>
Date: Thu, 16 Dec 2010 10:26:03 -0200
Subject: [PATCH] e1000e: convert to stats64

Quoted 9 lines

Provides accurate stats at the time user reads them.

---
 drivers/net/e1000e/e1000.h   |    3 ++ drivers/net/e1000e/ethtool.c |   25 ++++++++------- drivers/net/e1000e/netdev.c  |   68 +++++++++++++++++++++++++++++++++--------

 3 files changed, 70 insertions(+), 26 deletions(-)

I have dropped you previous version of the patch and applied v2 to my tree for review and testing.
Thanks Flavio!

Signature · 2 lines
Cheers,
Jeff
#7 lore raw
Quoted 47 lines · Jeff Kirsher
Quoted 36 lines · Flavio Leitner
Quoted 18 lines · Eric Dumazet
Quoted 17 lines · Flavio Leitner

Provides accurate stats at the time user reads them.

---
 drivers/net/e1000e/e1000.h   |    5 ++- drivers/net/e1000e/ethtool.c |   27 +++++++++------- drivers/net/e1000e/netdev.c  |   68 ++++++++++++++++++++++++-----------------

 3 files changed, 59 insertions(+), 41 deletions(-)
drivers/net/e1000e/e1000.h +0 -0
index fdc67fe..5a5e944 100644
@@ -363,6 +363,8 @@ struct e1000_adapter {
     /* structs defined in e1000_hw.h */
     struct e1000_hw hw;
 
Quoted 8 lines

drivers/net/e1000e/e1000.h struct e1000_adapter { · line 367

Quoted 2 lines
drivers/net/e1000e/e1000.h +2 -0
+   spinlock_t stats64_lock;
+   struct rtnl_link_stats64 stats64;

I am not sure why you add this stats64 in e1000_adapter ?

Why isnt it provided by callers (automatic variable, or provided to ndo_get_stats64()). I dont see accumulators, only a full rewrite of this structure in e1000e_update_stats() ?

Good point. I have modified the patch to fix that. thanks!

From 3487bd7dacd0c23bba315270139dab6e00e5ff02 Mon Sep 17 00:00:00 2001
From: Flavio Leitner <[email protected]>
Date: Thu, 16 Dec 2010 10:26:03 -0200
Subject: [PATCH] e1000e: convert to stats64

Quoted 9 lines

Provides accurate stats at the time user reads them.

---
 drivers/net/e1000e/e1000.h   |    3 ++ drivers/net/e1000e/ethtool.c |   25 ++++++++------- drivers/net/e1000e/netdev.c  |   68 +++++++++++++++++++++++++++++++++--------

 3 files changed, 70 insertions(+), 26 deletions(-)
Quoted 3 lines

I have dropped you previous version of the patch and applied v2 to my tree for review and testing.
Thanks Flavio!

Hi Jeff,

Do you have any feedback on this patch?
thanks,

Signature · 13 lines
Flavio

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
E1000-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit http://communities.intel.com/community/wired
#8 lore raw
Quoted 48 lines · Flavio Leitner
Quoted 47 lines · Jeff Kirsher
Quoted 45 lines · Flavio Leitner
Quoted 18 lines · Eric Dumazet
Quoted 17 lines · Flavio Leitner

Provides accurate stats at the time user reads them.

---
 drivers/net/e1000e/e1000.h   |    5 ++-
 drivers/net/e1000e/ethtool.c |   27 +++++++++-------
 drivers/net/e1000e/netdev.c  |   68 ++++++++++++++++++++++++-----------------
 3 files changed, 59 insertions(+), 41 deletions(-)
drivers/net/e1000e/e1000.h +0 -0
index fdc67fe..5a5e944 100644
@@ -363,6 +363,8 @@ struct e1000_adapter {
    /* structs defined in e1000_hw.h */
    struct e1000_hw hw;
 
Quoted 8 lines

drivers/net/e1000e/e1000.h struct e1000_adapter { · line 367

Quoted 2 lines
drivers/net/e1000e/e1000.h +2 -0
+   spinlock_t stats64_lock;
+   struct rtnl_link_stats64 stats64;

I am not sure why you add this stats64 in e1000_adapter ?

Why isnt it provided by callers (automatic variable, or provided to ndo_get_stats64()). I dont see accumulators, only a full rewrite of this structure in e1000e_update_stats() ?

Good point. I have modified the patch to fix that. thanks!

From 3487bd7dacd0c23bba315270139dab6e00e5ff02 Mon Sep 17 00:00:00 2001
From: Flavio Leitner <[email protected]>
Date: Thu, 16 Dec 2010 10:26:03 -0200
Subject: [PATCH] e1000e: convert to stats64

Provides accurate stats at the time user reads them.

---
 drivers/net/e1000e/e1000.h   |    3 ++
 drivers/net/e1000e/ethtool.c |   25 ++++++++-------
 drivers/net/e1000e/netdev.c  |   68 +++++++++++++++++++++++++++++++++--------
 3 files changed, 70 insertions(+), 26 deletions(-)
Quoted 8 lines
Quoted 3 lines

I have dropped you previous version of the patch and applied v2 to my tree for review and testing.
Thanks Flavio!

Hi Jeff,

Do you have any feedback on this patch?
thanks,

I have the patch ready to push to Dave for net-next, along with a few other e1000e patches. I was just waiting for net-next to open (which it did a few days ago).

#9 lore raw
In reply to Flavio Leitner
Quoted 9 lines · Flavio Leitner

Provides accurate stats at the time user reads them.

---
 drivers/net/e1000e/e1000.h   |    5 ++- drivers/net/e1000e/ethtool.c |   27 +++++++++------- drivers/net/e1000e/netdev.c  |   68 ++++++++++++++++++++++++-----------------

 3 files changed, 59 insertions(+), 41 deletions(-)

I have added this patch to my tree for review and testing. Thanks Flavio.

Signature · 14 lines
Cheers,
Jeff

------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
E1000-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit http://communities.intel.com/community/wired