aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel
diff options
context:
space:
mode:
authorJeff Kirsher <jeffrey.t.kirsher@intel.com>2015-04-03 16:26:58 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2015-04-14 18:35:02 -0400
commit29a928ee633a9166e5637609ce4c735856b23fbe (patch)
treef945aec09aaef97b9aa740dd5f814e1cd902ac70 /drivers/net/ethernet/intel
parent661b2067910fdecb9a7053f7b5279a0ff61b0bf7 (diff)
fm10k: only show actual queues, not the maximum in hardware
Currently, we show statistics for all 128 queues, even though we don't necessarily have that many queues available especially in the VF case. Instead, use the hw->mac.max_queues value, which tells us how many queues we actually have, rather than the space for the rings we allocated. In this way, we prevent dumping statistics that are useless on the VF. Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Acked-by: Matthew Vick <matthew.vick@intel.com> Tested-by: Krishneil Singh <krishneil.k.singh@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel')
-rw-r--r--drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c b/drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c
index 697a269b2145..478e67b4601e 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c
@@ -118,6 +118,7 @@ enum fm10k_self_test_types {
118 118
119static void fm10k_get_strings(struct net_device *dev, u32 stringset, u8 *data) 119static void fm10k_get_strings(struct net_device *dev, u32 stringset, u8 *data)
120{ 120{
121 struct fm10k_intfc *interface = netdev_priv(dev);
121 char *p = (char *)data; 122 char *p = (char *)data;
122 int i; 123 int i;
123 124
@@ -138,7 +139,7 @@ static void fm10k_get_strings(struct net_device *dev, u32 stringset, u8 *data)
138 p += ETH_GSTRING_LEN; 139 p += ETH_GSTRING_LEN;
139 } 140 }
140 141
141 for (i = 0; i < MAX_QUEUES; i++) { 142 for (i = 0; i < interface->hw.mac.max_queues; i++) {
142 sprintf(p, "tx_queue_%u_packets", i); 143 sprintf(p, "tx_queue_%u_packets", i);
143 p += ETH_GSTRING_LEN; 144 p += ETH_GSTRING_LEN;
144 sprintf(p, "tx_queue_%u_bytes", i); 145 sprintf(p, "tx_queue_%u_bytes", i);
@@ -188,7 +189,7 @@ static void fm10k_get_ethtool_stats(struct net_device *netdev,
188 sizeof(u64)) ? *(u64 *)p : *(u32 *)p; 189 sizeof(u64)) ? *(u64 *)p : *(u32 *)p;
189 } 190 }
190 191
191 for (i = 0; i < MAX_QUEUES; i++) { 192 for (i = 0; i < interface->hw.mac.max_queues; i++) {
192 struct fm10k_ring *ring; 193 struct fm10k_ring *ring;
193 u64 *queue_stat; 194 u64 *queue_stat;
194 195