aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2008-07-08 18:07:24 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-07-11 01:20:31 -0400
commite21ed3538f1946ea623caf28f1c44ede50224275 (patch)
treeb4ba81094a95de0d9396ded4e992699cbc3f6393
parent661086df6cf35f62d0aec09ccb9164eb2baaaecd (diff)
igb: update ethtool stats to support multiqueue
Addesses problems seen earlier with igb driver not correctly reporting rx and tx stats. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
-rw-r--r--drivers/net/igb/igb.h1
-rw-r--r--drivers/net/igb/igb_ethtool.c13
-rw-r--r--drivers/net/igb/igb_main.c2
3 files changed, 12 insertions, 4 deletions
diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
index a1431c8797b9..5915efccbcab 100644
--- a/drivers/net/igb/igb.h
+++ b/drivers/net/igb/igb.h
@@ -158,6 +158,7 @@ struct igb_ring {
158 union { 158 union {
159 /* TX */ 159 /* TX */
160 struct { 160 struct {
161 struct igb_queue_stats tx_stats;
161 bool detect_tx_hung; 162 bool detect_tx_hung;
162 }; 163 };
163 /* RX */ 164 /* RX */
diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
index 0447f9bcd27a..ed756c12aba6 100644
--- a/drivers/net/igb/igb_ethtool.c
+++ b/drivers/net/igb/igb_ethtool.c
@@ -96,10 +96,8 @@ static const struct igb_stats igb_gstrings_stats[] = {
96}; 96};
97 97
98#define IGB_QUEUE_STATS_LEN \ 98#define IGB_QUEUE_STATS_LEN \
99 ((((((struct igb_adapter *)netdev->priv)->num_rx_queues > 1) ? \ 99 ((((struct igb_adapter *)netdev->priv)->num_rx_queues + \
100 ((struct igb_adapter *)netdev->priv)->num_rx_queues : 0) + \ 100 ((struct igb_adapter *)netdev->priv)->num_tx_queues) * \
101 (((((struct igb_adapter *)netdev->priv)->num_tx_queues > 1) ? \
102 ((struct igb_adapter *)netdev->priv)->num_tx_queues : 0))) * \
103 (sizeof(struct igb_queue_stats) / sizeof(u64))) 101 (sizeof(struct igb_queue_stats) / sizeof(u64)))
104#define IGB_GLOBAL_STATS_LEN \ 102#define IGB_GLOBAL_STATS_LEN \
105 sizeof(igb_gstrings_stats) / sizeof(struct igb_stats) 103 sizeof(igb_gstrings_stats) / sizeof(struct igb_stats)
@@ -1842,6 +1840,13 @@ static void igb_get_ethtool_stats(struct net_device *netdev,
1842 data[i] = (igb_gstrings_stats[i].sizeof_stat == 1840 data[i] = (igb_gstrings_stats[i].sizeof_stat ==
1843 sizeof(u64)) ? *(u64 *)p : *(u32 *)p; 1841 sizeof(u64)) ? *(u64 *)p : *(u32 *)p;
1844 } 1842 }
1843 for (j = 0; j < adapter->num_tx_queues; j++) {
1844 int k;
1845 queue_stat = (u64 *)&adapter->tx_ring[j].tx_stats;
1846 for (k = 0; k < stat_count; k++)
1847 data[i + k] = queue_stat[k];
1848 i += k;
1849 }
1845 for (j = 0; j < adapter->num_rx_queues; j++) { 1850 for (j = 0; j < adapter->num_rx_queues; j++) {
1846 int k; 1851 int k;
1847 queue_stat = (u64 *)&adapter->rx_ring[j].rx_stats; 1852 queue_stat = (u64 *)&adapter->rx_ring[j].rx_stats;
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index e11a5dae668a..f975bfec2265 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -3431,6 +3431,8 @@ done_cleaning:
3431 } 3431 }
3432 tx_ring->total_bytes += total_bytes; 3432 tx_ring->total_bytes += total_bytes;
3433 tx_ring->total_packets += total_packets; 3433 tx_ring->total_packets += total_packets;
3434 tx_ring->tx_stats.bytes += total_bytes;
3435 tx_ring->tx_stats.packets += total_packets;
3434 adapter->net_stats.tx_bytes += total_bytes; 3436 adapter->net_stats.tx_bytes += total_bytes;
3435 adapter->net_stats.tx_packets += total_packets; 3437 adapter->net_stats.tx_packets += total_packets;
3436 return retval; 3438 return retval;