[Intel-wired-lan] [iwl-net v1] iavf: fix VF stats not updating due to PTP command preemption
Tomasz Lichwala <[email protected]> Thu, 23 Jul 2026 17:28:23 +0200
| Newsgroups | org.osuosl.intel-wired-lan |
|---|---|
| Message-ID | <[email protected]> |
Since the introduction of PTP support in iavf, commit 7c01dbfc8a1c
("iavf: periodically cache PHC time"), the periodic PTP clock caching
task always provides a pending admin queue command, causing
iavf_process_aq_command() to always return success and permanently
preventing the stats fallback path from executing, which results in VF
statistics remaining at zero despite traffic flowing.
Fix this by making the stats request unconditional when the adapter is in
the running state, rather than relying on it as a fallback when no other
admin queue commands were processed.
Fixes: 7c01dbfc8a1c ("iavf: periodically cache PHC time")
Reviewed-by: Aleksandr Loktionov <[email protected]>
Signed-off-by: Tomasz Lichwala <[email protected]>
---
drivers/net/ethernet/intel/iavf/iavf_main.c | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c
index f5697d9c97fe..a05bd61d7de1 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_main.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
@@ -2986,18 +2986,12 @@ static int iavf_watchdog_step(struct iavf_adapter *adapter)
iavf_send_api_ver(adapter);
}
} else {
- int ret = iavf_process_aq_command(adapter);
-
- /* An error will be returned if no commands were
- * processed; use this opportunity to update stats
- * if the error isn't -ENOTSUPP
- */
- if (ret && ret != -EOPNOTSUPP &&
- adapter->state == __IAVF_RUNNING)
- iavf_request_stats(adapter);
+ iavf_process_aq_command(adapter);
}
- if (adapter->state == __IAVF_RUNNING)
+ if (adapter->state == __IAVF_RUNNING) {
+ iavf_request_stats(adapter);
iavf_detect_recover_hung(&adapter->vsi);
+ }
break;
case __IAVF_REMOVE:
default:
--
2.54.0