Skip to contentSkip to conversation

iavf: fix VF stats not updating due to PTP command preemption

PATCH Superseded Tomasz Lichwala 2 participants 2 messages Jul 23 – Sep 8

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iavf: fix VF stats not updating due to PTP command preemption

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")
---
 drivers/net/ethernet/intel/iavf/iavf_main.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)
drivers/net/ethernet/intel/iavf/iavf_main.c +4 -10
index f5697d9c97fe..a05bd61d7de1 100644
@@ -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:
Signature · 1 line
2.54.0
Tested-by on v1 1/1
#1 lore raw
Quoted 56 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Tomasz Lichwala
Sent: Thursday, July 23, 2026 5:28 PM
To: [email protected]
Cc: Tomasz Lichwala <[email protected]>; Loktionov, Aleksandr <[email protected]>
Subject: [Intel-wired-lan] [iwl-net v1] iavf: fix VF stats not updating due to PTP command preemption

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")
---
 drivers/net/ethernet/intel/iavf/iavf_main.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)
drivers/net/ethernet/intel/iavf/iavf_main.c +4 -10
index f5697d9c97fe..a05bd61d7de1 100644
@@ -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:
Quoted 3 lines

default:
--
2.54.0