ixgbe: lro stats were not counted on first ethtool -Scall
authorJesse Brandeburg <jesse.brandeburg@intel.com>
Fri, 12 Sep 2008 02:59:29 +0000 (19:59 -0700)
committerJeff Garzik <jgarzik@redhat.com>
Wed, 24 Sep 2008 22:54:58 +0000 (18:54 -0400)
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/net/ixgbe/ixgbe_ethtool.c

index 928b97cc1700d6efd48145a08dec2a69e4d2b675..4701abf3a59b69b82c5e528ed37011cc3addfefb 100644 (file)
@@ -774,6 +774,14 @@ static void ixgbe_get_ethtool_stats(struct net_device *netdev,
        int j, k;
        int i;
        u64 aggregated = 0, flushed = 0, no_desc = 0;
+       for (i = 0; i < adapter->num_rx_queues; i++) {
+               aggregated += adapter->rx_ring[i].lro_mgr.stats.aggregated;
+               flushed += adapter->rx_ring[i].lro_mgr.stats.flushed;
+               no_desc += adapter->rx_ring[i].lro_mgr.stats.no_desc;
+       }
+       adapter->lro_aggregated = aggregated;
+       adapter->lro_flushed = flushed;
+       adapter->lro_no_desc = no_desc;
 
        ixgbe_update_stats(adapter);
        for (i = 0; i < IXGBE_GLOBAL_STATS_LEN; i++) {
@@ -788,17 +796,11 @@ static void ixgbe_get_ethtool_stats(struct net_device *netdev,
                i += k;
        }
        for (j = 0; j < adapter->num_rx_queues; j++) {
-               aggregated += adapter->rx_ring[j].lro_mgr.stats.aggregated;
-               flushed += adapter->rx_ring[j].lro_mgr.stats.flushed;
-               no_desc += adapter->rx_ring[j].lro_mgr.stats.no_desc;
                queue_stat = (u64 *)&adapter->rx_ring[j].stats;
                for (k = 0; k < stat_count; k++)
                        data[i + k] = queue_stat[k];
                i += k;
        }
-       adapter->lro_aggregated = aggregated;
-       adapter->lro_flushed = flushed;
-       adapter->lro_no_desc = no_desc;
 }
 
 static void ixgbe_get_strings(struct net_device *netdev, u32 stringset,