The device watchdog polls VFGEN_RSTAT to detect a VF reset and drives
the auto-reset recovery path.
It is disabled when a link-up event arrives, on the assumption that a
working link means no reset is in flight.
That assumption does not hold during recovery.
Keep the watchdog armed while vf->in_reset_recovery is set, and enable
it on VIRTCHNL_EVENT_RESET_IMPENDING, so it stays armed from the PF
reset notification until recovery completes.
Fixes: ece7d7eef04f ("net/iavf: fix duplicate VF reset during PF reset
recovery")
Signed-off-by: Anurag Mandal <[email protected]>
---
drivers/net/intel/iavf/iavf_vchnl.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/intel/iavf/iavf_vchnl.c
b/drivers/net/intel/iavf/iavf_vchnl.c
index e04afe1d6a..3fa0496b89 100644
--- a/drivers/net/intel/iavf/iavf_vchnl.c
+++ b/drivers/net/intel/iavf/iavf_vchnl.c
@@ -260,7 +260,7 @@ iavf_handle_link_change_event(struct rte_eth_dev *dev,
* (link is down or a VF reset is in progress); the watchdog drives
* auto-reset recovery, so it must remain armed in those cases.
*/
- if (vf->link_up && !vf->vf_reset)
+ if (vf->link_up && !vf->vf_reset && !vf->in_reset_recovery)
iavf_dev_watchdog_disable(adapter);
else
iavf_dev_watchdog_enable(adapter);
@@ -334,6 +334,7 @@ iavf_read_msg_from_pf(struct iavf_adapter *adapter,
uint16_t buf_len,
if (!vf->vf_reset) {
vf->vf_reset = true;
iavf_set_no_poll(adapter, false);
+ iavf_dev_watchdog_enable(adapter);
if (adapter->devargs.no_poll_on_link_down)
iavf_dev_tx_drain(vf->eth_dev);
iavf_dev_event_post(vf->eth_dev,
@@ -574,6 +575,7 @@ iavf_handle_pf_event_msg(struct rte_eth_dev *dev, uint8_t
*msg,
if (!vf->vf_reset) {
vf->vf_reset = true;
iavf_set_no_poll(adapter, false);
+ iavf_dev_watchdog_enable(adapter);
if (adapter->devargs.no_poll_on_link_down)
iavf_dev_tx_drain(dev);
iavf_dev_event_post(dev, RTE_ETH_EVENT_INTR_RESET,
--
2.34.1