git: 02fbb1ce07f6 - main - iavf: Resume AdminQ processing after PF reset

Kevin Bowling <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.src
Message-ID <6a79d96c.1feb1.7943a2d8__45084.5111905196$1786370448$gmane$org@gitrepo.freebsd.org>
The branch main has been updated by kbowling:

URL: https://cgit.FreeBSD.org/src/commit/?id=02fbb1ce07f60fab82e21e5bbe2dae85f024bb55

commit 02fbb1ce07f60fab82e21e5bbe2dae85f024bb55
Author:     Kevin Bowling <[email protected]>
AuthorDate: 2026-08-10 10:54:26 +0000
Commit:     Kevin Bowling <[email protected]>
CommitDate: 2026-08-10 13:59:53 +0000

    iavf: Resume AdminQ processing after PF reset
    
    A PF reset indication leaves IAVF_STATE_RESET_PENDING set while the
    VF recreates its AdminQ and negotiates new resources.  The ordinary
    AdminQ task refuses to consume messages while that state is set.
    Consequently, the first DISABLE_QUEUES reply after successful mailbox
    rediscovery remains in the receive queue and initialization times out.
    Later retries and manual interface restarts repeat the same cycle.
    
    Clear the stale reset indication once VERSION and GET_VF_RESOURCES have
    succeeded, before enabling interrupts and resuming normal virtchnl
    requests.
    
    MFC after:      2 weeks
---
 sys/dev/iavf/if_iavf_iflib.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/sys/dev/iavf/if_iavf_iflib.c b/sys/dev/iavf/if_iavf_iflib.c
index 82ba7a92b008..c9fed8493103 100644
--- a/sys/dev/iavf/if_iavf_iflib.c
+++ b/sys/dev/iavf/if_iavf_iflib.c
@@ -959,6 +959,14 @@ iavf_reestablish_vc(struct iavf_sc *sc)
 		goto fail;
 	}
 
+	/*
+	 * RESET_PENDING prevents the ordinary AdminQ task from consuming
+	 * messages while the queue may still belong to the pre-reset device.
+	 * The successful VERSION and GET_VF_RESOURCES exchange above proves
+	 * that the reset has completed and this is the replacement AdminQ.
+	 * Clear the stale indication before normal virtchnl requests resume.
+	 */
+	iavf_clear_state(&sc->state, IAVF_STATE_RESET_PENDING);
 	iavf_enable_adminq_irq(hw);
 	return (0);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.