| From 93f6bc4e56e7a2a2ab9081e131423123d6e41372 Mon Sep 17 00:00:00 2001 |
| From: Sasha Levin <sashal@kernel.org> |
| Date: Wed, 24 Jun 2020 09:04:22 -0700 |
| Subject: iavf: Fix updating statistics |
| |
| From: Tony Nguyen <anthony.l.nguyen@intel.com> |
| |
| [ 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 | 5 ++++- |
| 1 file changed, 4 insertions(+), 1 deletion(-) |
| |
| diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c |
| index 8deff711cc02c..a4b2ad29e132a 100644 |
| --- a/drivers/net/ethernet/intel/iavf/iavf_main.c |
| +++ b/drivers/net/ethernet/intel/iavf/iavf_main.c |
| @@ -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); |
| } |
| -- |
| 2.25.1 |
| |