patch 'net/iavf: fix race between watchdog enable and disable' has been queued to stable release 25.11.5

Kevin Traynor ktraynor at redhat.com
Thu Dec 3 14:05:42 CET 2026


Hi,

FYI, your patch has been queued to stable release 25.11.5

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 12/08/26. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/f69bf3706ff7f6d0968be481ff0074a2dc2e9054

Thanks.

Kevin

---
>From f69bf3706ff7f6d0968be481ff0074a2dc2e9054 Mon Sep 17 00:00:00 2001
From: Ciara Loftus <ciara.loftus at intel.com>
Date: Fri, 6 Nov 2026 09:40:12 +0000
Subject: [PATCH] net/iavf: fix race between watchdog enable and disable

[ upstream commit 7ce6e7798f5184d62de473b46fd975d50feb0709 ]

iavf_dev_watchdog_enable() runs on the interrupt thread from the link
change and reset impending handlers, while iavf_dev_watchdog_disable()
runs on a control thread from dev_stop and dev_close. Disable clears
`watchdog_enabled` before cancelling the alarm. An enable landing in
between sets the flag again and arms a new alarm, which the cancel then
removes. The flag is left set with no alarm armed, so every later enable
is a no-op and the watchdog is dead until the port is re-probed.

Serialise enable and disable with a spinlock held across the flag
update and the alarm set or cancel.

Fixes: 4c9b1d2ff616 ("net/iavf: refactor watchdog")

Signed-off-by: Ciara Loftus <ciara.loftus at intel.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
---
 drivers/net/intel/iavf/iavf.h        |  1 +
 drivers/net/intel/iavf/iavf_ethdev.c | 37 +++++++++++++++++-----------
 2 files changed, 23 insertions(+), 15 deletions(-)

diff --git a/drivers/net/intel/iavf/iavf.h b/drivers/net/intel/iavf/iavf.h
index 9bef248e81..3f2f39ec19 100644
--- a/drivers/net/intel/iavf/iavf.h
+++ b/drivers/net/intel/iavf/iavf.h
@@ -248,4 +248,5 @@ struct iavf_info {
 	/** iAVF watchdog enable */
 	bool watchdog_enabled;
+	rte_spinlock_t watchdog_lock;
 
 	/* Event from pf */
diff --git a/drivers/net/intel/iavf/iavf_ethdev.c b/drivers/net/intel/iavf/iavf_ethdev.c
index c111da4a49..103418bec9 100644
--- a/drivers/net/intel/iavf/iavf_ethdev.c
+++ b/drivers/net/intel/iavf/iavf_ethdev.c
@@ -352,14 +352,17 @@ iavf_dev_watchdog_enable(struct iavf_adapter *adapter)
 	if (!adapter->devargs.watchdog_period) {
 		PMD_DRV_LOG(INFO, "Device watchdog is disabled");
-	} else {
-		if (!adapter->vf.watchdog_enabled) {
-			PMD_DRV_LOG(INFO, "Enabling device watchdog, period is %dμs",
-						adapter->devargs.watchdog_period);
-			adapter->vf.watchdog_enabled = true;
-			if (rte_eal_alarm_set(adapter->devargs.watchdog_period,
-						&iavf_dev_watchdog, (void *)adapter))
-				PMD_DRV_LOG(ERR, "Failed to enable device watchdog");
-		}
+		return;
 	}
+
+	rte_spinlock_lock(&adapter->vf.watchdog_lock);
+	if (!adapter->vf.watchdog_enabled) {
+		PMD_DRV_LOG(INFO, "Enabling device watchdog, period is %dμs",
+					adapter->devargs.watchdog_period);
+		adapter->vf.watchdog_enabled = true;
+		if (rte_eal_alarm_set(adapter->devargs.watchdog_period,
+					&iavf_dev_watchdog, (void *)adapter))
+			PMD_DRV_LOG(ERR, "Failed to enable device watchdog");
+	}
+	rte_spinlock_unlock(&adapter->vf.watchdog_lock);
 }
 
@@ -369,11 +372,14 @@ iavf_dev_watchdog_disable(struct iavf_adapter *adapter)
 	if (!adapter->devargs.watchdog_period) {
 		PMD_DRV_LOG(INFO, "Device watchdog is not enabled");
-	} else {
-		if (adapter->vf.watchdog_enabled) {
-			PMD_DRV_LOG(INFO, "Disabling device watchdog");
-			adapter->vf.watchdog_enabled = false;
-			rte_eal_alarm_cancel(&iavf_dev_watchdog, (void *)adapter);
-		}
+		return;
 	}
+
+	rte_spinlock_lock(&adapter->vf.watchdog_lock);
+	if (adapter->vf.watchdog_enabled) {
+		PMD_DRV_LOG(INFO, "Disabling device watchdog");
+		adapter->vf.watchdog_enabled = false;
+		rte_eal_alarm_cancel(&iavf_dev_watchdog, (void *)adapter);
+	}
+	rte_spinlock_unlock(&adapter->vf.watchdog_lock);
 }
 
@@ -3004,4 +3010,5 @@ iavf_dev_init(struct rte_eth_dev *eth_dev)
 	adapter->mac_primary_set = false;
 	rte_spinlock_init(&adapter->phc_sync_lock);
+	rte_spinlock_init(&vf->watchdog_lock);
 
 	if (!vf->in_reset_recovery && iavf_dev_event_handler_init())
-- 
2.56.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-12-03 12:52:50.942911060 +0000
+++ 0416-net-iavf-fix-race-between-watchdog-enable-and-disabl.patch	2026-12-03 12:52:39.312938800 +0000
@@ -1 +1 @@
-From 7ce6e7798f5184d62de473b46fd975d50feb0709 Mon Sep 17 00:00:00 2001
+From f69bf3706ff7f6d0968be481ff0074a2dc2e9054 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 7ce6e7798f5184d62de473b46fd975d50feb0709 ]
+
@@ -18 +19,0 @@
-Cc: stable at dpdk.org
@@ -28 +29 @@
-index 04c2900afe..0c98ae28e1 100644
+index 9bef248e81..3f2f39ec19 100644
@@ -38 +39 @@
-index 83470a636d..10069feae2 100644
+index c111da4a49..103418bec9 100644
@@ -41 +42 @@
-@@ -375,14 +375,17 @@ iavf_dev_watchdog_enable(struct iavf_adapter *adapter)
+@@ -352,14 +352,17 @@ iavf_dev_watchdog_enable(struct iavf_adapter *adapter)
@@ -68 +69 @@
-@@ -392,11 +395,14 @@ iavf_dev_watchdog_disable(struct iavf_adapter *adapter)
+@@ -369,11 +372,14 @@ iavf_dev_watchdog_disable(struct iavf_adapter *adapter)
@@ -89,2 +90,2 @@
-@@ -3078,4 +3084,5 @@ iavf_dev_init(struct rte_eth_dev *eth_dev)
- 	adapter->tpid = RTE_ETHER_TYPE_VLAN; /* VLAN TPID set to 0x8100 by default */
+@@ -3004,4 +3010,5 @@ iavf_dev_init(struct rte_eth_dev *eth_dev)
+ 	adapter->mac_primary_set = false;
@@ -94 +95 @@
- 	if (!rte_atomic_load_explicit(&vf->in_reset_recovery, rte_memory_order_relaxed) &&
+ 	if (!vf->in_reset_recovery && iavf_dev_event_handler_init())



More information about the stable mailing list