Commit 29a928ee authored by Jeff Kirsher's avatar Jeff Kirsher

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: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
Acked-by: default avatarMatthew Vick <matthew.vick@intel.com>
Tested-by: default avatarKrishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 661b2067
...@@ -118,6 +118,7 @@ enum fm10k_self_test_types { ...@@ -118,6 +118,7 @@ enum fm10k_self_test_types {
static void fm10k_get_strings(struct net_device *dev, u32 stringset, u8 *data) static void fm10k_get_strings(struct net_device *dev, u32 stringset, u8 *data)
{ {
struct fm10k_intfc *interface = netdev_priv(dev);
char *p = (char *)data; char *p = (char *)data;
int i; int i;
...@@ -138,7 +139,7 @@ static void fm10k_get_strings(struct net_device *dev, u32 stringset, u8 *data) ...@@ -138,7 +139,7 @@ static void fm10k_get_strings(struct net_device *dev, u32 stringset, u8 *data)
p += ETH_GSTRING_LEN; p += ETH_GSTRING_LEN;
} }
for (i = 0; i < MAX_QUEUES; i++) { for (i = 0; i < interface->hw.mac.max_queues; i++) {
sprintf(p, "tx_queue_%u_packets", i); sprintf(p, "tx_queue_%u_packets", i);
p += ETH_GSTRING_LEN; p += ETH_GSTRING_LEN;
sprintf(p, "tx_queue_%u_bytes", i); sprintf(p, "tx_queue_%u_bytes", i);
...@@ -188,7 +189,7 @@ static void fm10k_get_ethtool_stats(struct net_device *netdev, ...@@ -188,7 +189,7 @@ static void fm10k_get_ethtool_stats(struct net_device *netdev,
sizeof(u64)) ? *(u64 *)p : *(u32 *)p; sizeof(u64)) ? *(u64 *)p : *(u32 *)p;
} }
for (i = 0; i < MAX_QUEUES; i++) { for (i = 0; i < interface->hw.mac.max_queues; i++) {
struct fm10k_ring *ring; struct fm10k_ring *ring;
u64 *queue_stat; u64 *queue_stat;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment