Skip to content

Commit

Permalink
iavf: Fix updating statistics
Browse files Browse the repository at this point in the history
Commit bac8486 ("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: bac8486 ("iavf: Refactor the watchdog state machine")
Signed-off-by: Tony Nguyen <[email protected]>
Tested-by: Andrew Bowers <[email protected]>
  • Loading branch information
anguy11 committed Jul 1, 2020
1 parent 44ea803 commit 9358076
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/net/ethernet/intel/iavf/iavf_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1937,7 +1937,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);
}
Expand Down

0 comments on commit 9358076

Please sign in to comment.