diff options
Diffstat (limited to 'drivers/net/igb/igb_ethtool.c')
-rw-r--r-- | drivers/net/igb/igb_ethtool.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c index b8551a57dd3f..2ae98f91372e 100644 --- a/drivers/net/igb/igb_ethtool.c +++ b/drivers/net/igb/igb_ethtool.c | |||
@@ -96,9 +96,10 @@ 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(netdev))->num_rx_queues + \ | 99 | (((((struct igb_adapter *)netdev_priv(netdev))->num_rx_queues)* \ |
100 | ((struct igb_adapter *)netdev_priv(netdev))->num_tx_queues) * \ | 100 | (sizeof(struct igb_rx_queue_stats) / sizeof(u64))) + \ |
101 | (sizeof(struct igb_queue_stats) / sizeof(u64))) | 101 | ((((struct igb_adapter *)netdev_priv(netdev))->num_tx_queues) * \ |
102 | (sizeof(struct igb_tx_queue_stats) / sizeof(u64)))) | ||
102 | #define IGB_GLOBAL_STATS_LEN \ | 103 | #define IGB_GLOBAL_STATS_LEN \ |
103 | sizeof(igb_gstrings_stats) / sizeof(struct igb_stats) | 104 | sizeof(igb_gstrings_stats) / sizeof(struct igb_stats) |
104 | #define IGB_STATS_LEN (IGB_GLOBAL_STATS_LEN + IGB_QUEUE_STATS_LEN) | 105 | #define IGB_STATS_LEN (IGB_GLOBAL_STATS_LEN + IGB_QUEUE_STATS_LEN) |
@@ -1960,7 +1961,8 @@ static void igb_get_ethtool_stats(struct net_device *netdev, | |||
1960 | { | 1961 | { |
1961 | struct igb_adapter *adapter = netdev_priv(netdev); | 1962 | struct igb_adapter *adapter = netdev_priv(netdev); |
1962 | u64 *queue_stat; | 1963 | u64 *queue_stat; |
1963 | int stat_count = sizeof(struct igb_queue_stats) / sizeof(u64); | 1964 | int stat_count_tx = sizeof(struct igb_tx_queue_stats) / sizeof(u64); |
1965 | int stat_count_rx = sizeof(struct igb_rx_queue_stats) / sizeof(u64); | ||
1964 | int j; | 1966 | int j; |
1965 | int i; | 1967 | int i; |
1966 | 1968 | ||
@@ -1973,14 +1975,14 @@ static void igb_get_ethtool_stats(struct net_device *netdev, | |||
1973 | for (j = 0; j < adapter->num_tx_queues; j++) { | 1975 | for (j = 0; j < adapter->num_tx_queues; j++) { |
1974 | int k; | 1976 | int k; |
1975 | queue_stat = (u64 *)&adapter->tx_ring[j].tx_stats; | 1977 | queue_stat = (u64 *)&adapter->tx_ring[j].tx_stats; |
1976 | for (k = 0; k < stat_count; k++) | 1978 | for (k = 0; k < stat_count_tx; k++) |
1977 | data[i + k] = queue_stat[k]; | 1979 | data[i + k] = queue_stat[k]; |
1978 | i += k; | 1980 | i += k; |
1979 | } | 1981 | } |
1980 | for (j = 0; j < adapter->num_rx_queues; j++) { | 1982 | for (j = 0; j < adapter->num_rx_queues; j++) { |
1981 | int k; | 1983 | int k; |
1982 | queue_stat = (u64 *)&adapter->rx_ring[j].rx_stats; | 1984 | queue_stat = (u64 *)&adapter->rx_ring[j].rx_stats; |
1983 | for (k = 0; k < stat_count; k++) | 1985 | for (k = 0; k < stat_count_rx; k++) |
1984 | data[i + k] = queue_stat[k]; | 1986 | data[i + k] = queue_stat[k]; |
1985 | i += k; | 1987 | i += k; |
1986 | } | 1988 | } |
@@ -2014,6 +2016,8 @@ static void igb_get_strings(struct net_device *netdev, u32 stringset, u8 *data) | |||
2014 | p += ETH_GSTRING_LEN; | 2016 | p += ETH_GSTRING_LEN; |
2015 | sprintf(p, "rx_queue_%u_bytes", i); | 2017 | sprintf(p, "rx_queue_%u_bytes", i); |
2016 | p += ETH_GSTRING_LEN; | 2018 | p += ETH_GSTRING_LEN; |
2019 | sprintf(p, "rx_queue_%u_drops", i); | ||
2020 | p += ETH_GSTRING_LEN; | ||
2017 | } | 2021 | } |
2018 | /* BUG_ON(p - data != IGB_STATS_LEN * ETH_GSTRING_LEN); */ | 2022 | /* BUG_ON(p - data != IGB_STATS_LEN * ETH_GSTRING_LEN); */ |
2019 | break; | 2023 | break; |