Skip to content

Commit 3d57fd1

Browse files
dmertmanJeff Kirsher
authored andcommitted
ice: Report stats when VSI is down
There is currently a check in get_ndo_stats that returns before updating stats if the VSI is down or there are no Tx or Rx queues. This causes the netdev to report zero stats with the netdev is down. Remove the check so that the behavior of reporting stats is the same as it was in IXGBE. Signed-off-by: Dave Ertman <david.m.ertman@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
1 parent 06914ac commit 3d57fd1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/net/ethernet/intel/ice/ice_main.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3477,12 +3477,16 @@ void ice_get_stats64(struct net_device *netdev, struct rtnl_link_stats64 *stats)
34773477

34783478
vsi_stats = &vsi->net_stats;
34793479

3480-
if (test_bit(__ICE_DOWN, vsi->state) || !vsi->num_txq || !vsi->num_rxq)
3480+
if (!vsi->num_txq || !vsi->num_rxq)
34813481
return;
3482+
34823483
/* netdev packet/byte stats come from ring counter. These are obtained
34833484
* by summing up ring counters (done by ice_update_vsi_ring_stats).
3485+
* But, only call the update routine and read the registers if VSI is
3486+
* not down.
34843487
*/
3485-
ice_update_vsi_ring_stats(vsi);
3488+
if (!test_bit(__ICE_DOWN, vsi->state))
3489+
ice_update_vsi_ring_stats(vsi);
34863490
stats->tx_packets = vsi_stats->tx_packets;
34873491
stats->tx_bytes = vsi_stats->tx_bytes;
34883492
stats->rx_packets = vsi_stats->rx_packets;

0 commit comments

Comments
 (0)