]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
iavf: Fix updating statistics
authorTony Nguyen <anthony.l.nguyen@intel.com>
Wed, 24 Jun 2020 16:04:22 +0000 (09:04 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Aug 2020 06:16:09 +0000 (08:16 +0200)
[ Upstream commit 9358076642f14cec8c414850d5a909cafca3a9d6 ]

Commit bac8486116b0 ("iavf: Refactor the watchdog state machine") inverted
the logic for when to update statistics. Statistics should be updated when
no other commands are pending, instead they were only requested when a
command was processed. iavf_request_stats() would see a pending request
and not request statistics to be updated. This caused statistics to never
be updated; fix the logic.

Fixes: bac8486116b0 ("iavf: Refactor the watchdog state machine")
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/iavf/iavf_main.c

index 905fc45b4a58f0834debcdd5bf66aed5be87fd70..34124c213d27c96678197c842aba623a880196c3 100644 (file)
@@ -1948,7 +1948,10 @@ static void iavf_watchdog_task(struct work_struct *work)
                                iavf_send_api_ver(adapter);
                        }
                } else {
-                       if (!iavf_process_aq_command(adapter) &&
+                       /* An error will be returned if no commands were
+                        * processed; use this opportunity to update stats
+                        */
+                       if (iavf_process_aq_command(adapter) &&
                            adapter->state == __IAVF_RUNNING)
                                iavf_request_stats(adapter);
                }