aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/sfc/siena.c
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2012-07-04 17:25:07 -0400
committerBen Hutchings <bhutchings@solarflare.com>2012-07-17 11:12:34 -0400
commitb7f514af7d6f36bc2f683e04a909c95e4744b95b (patch)
tree3e8919c3f81d3434d5252ede948d992a1a25deb0 /drivers/net/ethernet/sfc/siena.c
parentd4f2cecce138c34960c467d0ae38a6d4bcd6af7b (diff)
sfc: Fix interface statistics running backward
Some interface statistics are computed in such a way that they can sometimes decrease (and even underflow). Since the computed value will never be greater than the true value, we fix this by only storing the computed value when it increases. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'drivers/net/ethernet/sfc/siena.c')
-rw-r--r--drivers/net/ethernet/sfc/siena.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/ethernet/sfc/siena.c b/drivers/net/ethernet/sfc/siena.c
index 2354886293db..6bafd216e55e 100644
--- a/drivers/net/ethernet/sfc/siena.c
+++ b/drivers/net/ethernet/sfc/siena.c
@@ -458,8 +458,8 @@ static int siena_try_update_nic_stats(struct efx_nic *efx)
458 458
459 MAC_STAT(tx_bytes, TX_BYTES); 459 MAC_STAT(tx_bytes, TX_BYTES);
460 MAC_STAT(tx_bad_bytes, TX_BAD_BYTES); 460 MAC_STAT(tx_bad_bytes, TX_BAD_BYTES);
461 mac_stats->tx_good_bytes = (mac_stats->tx_bytes - 461 efx_update_diff_stat(&mac_stats->tx_good_bytes,
462 mac_stats->tx_bad_bytes); 462 mac_stats->tx_bytes - mac_stats->tx_bad_bytes);
463 MAC_STAT(tx_packets, TX_PKTS); 463 MAC_STAT(tx_packets, TX_PKTS);
464 MAC_STAT(tx_bad, TX_BAD_FCS_PKTS); 464 MAC_STAT(tx_bad, TX_BAD_FCS_PKTS);
465 MAC_STAT(tx_pause, TX_PAUSE_PKTS); 465 MAC_STAT(tx_pause, TX_PAUSE_PKTS);
@@ -492,8 +492,8 @@ static int siena_try_update_nic_stats(struct efx_nic *efx)
492 MAC_STAT(tx_ip_src_error, TX_IP_SRC_ERR_PKTS); 492 MAC_STAT(tx_ip_src_error, TX_IP_SRC_ERR_PKTS);
493 MAC_STAT(rx_bytes, RX_BYTES); 493 MAC_STAT(rx_bytes, RX_BYTES);
494 MAC_STAT(rx_bad_bytes, RX_BAD_BYTES); 494 MAC_STAT(rx_bad_bytes, RX_BAD_BYTES);
495 mac_stats->rx_good_bytes = (mac_stats->rx_bytes - 495 efx_update_diff_stat(&mac_stats->rx_good_bytes,
496 mac_stats->rx_bad_bytes); 496 mac_stats->rx_bytes - mac_stats->rx_bad_bytes);
497 MAC_STAT(rx_packets, RX_PKTS); 497 MAC_STAT(rx_packets, RX_PKTS);
498 MAC_STAT(rx_good, RX_GOOD_PKTS); 498 MAC_STAT(rx_good, RX_GOOD_PKTS);
499 MAC_STAT(rx_bad, RX_BAD_FCS_PKTS); 499 MAC_STAT(rx_bad, RX_BAD_FCS_PKTS);