]> git.karo-electronics.de Git - linux-beck.git/commitdiff
sfc: Reset derived rx_bad_bytes statistic when EF10 MC is rebooted
authorBen Hutchings <bhutchings@solarflare.com>
Thu, 5 Sep 2013 21:46:10 +0000 (22:46 +0100)
committerBen Hutchings <bhutchings@solarflare.com>
Wed, 11 Sep 2013 14:29:51 +0000 (15:29 +0100)
If the MC reboots then the stats it reports to us will have been
reset.  We need to reset ours to get efx_update_diff_stat() working
properly.

(This is a re-run of commit 876be083b669 'sfc: Reset driver's
MAC stats after MC reboot seen'.)

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
drivers/net/ethernet/sfc/ef10.c

index 357a6e5229c792923ee29ace50a3256142981881..80a6eea49e3645f8a32309d635e48c469e463970 100644 (file)
@@ -708,6 +708,11 @@ static int efx_ef10_mcdi_poll_reboot(struct efx_nic *efx)
        nic_data->must_restore_filters = true;
        nic_data->rx_rss_context = EFX_EF10_RSS_CONTEXT_INVALID;
 
+       /* MAC statistics have been cleared on the NIC; clear the local
+        * statistic that we update with efx_update_diff_stat().
+        */
+       nic_data->stats[EF10_STAT_rx_bad_bytes] = 0;
+
        return -EIO;
 }