From nobody Thu Aug 6 07:38:47 2026 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4hFzfv3fqzz6p29X for ; Thu, 06 Aug 2026 07:38:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hFzfv3BGnz3DVm for ; Thu, 06 Aug 2026 07:38:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786001927; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nAE/xtFooaOVhhq6CScA7/gyykvMRWNxvDiW5h0AJ4k=; b=h4J52j+/Gts20IxbrOEs5Z9XMlFIVl7wSglhMOphyATDks7t3lkr+y2LMEr6R+fIOaV1zL JCq/WATxW72ejQjmqqRMtl8nseZV4MSBWS5MrRu5UlwfcXhcfNT1Eit4wAevzOAQ73iSxw KIYe4hUYjwSDQ0sUznAS80mSN9x5zYfK35HOVvBh/CSmdu9U+sNa6Ng+tLgnGYgULptHeu UcYhS8ouM/SFz7gHt0gPnHdwxf+DygVF4yKHlmC4p8niV/kcXJyAN2yQERYPZhtTEZv65h 9PeSRoVUzyai2/2HM/Y8/XwCpcHhQ9kscU9ZGE3ArmvXimZN4OOTjg2wTZ8jsg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1786001927; a=rsa-sha256; cv=none; b=dCWCu5IsF6bUIuodHo2BbRlFmKn5hWLJCnxVMUjIzEa9fm+CSnFA4Do8K5zQVeL76FEJ4S hqwAY7/Tt63tHUYWG7TKviZKUxy+8z4nTvvGgz0kEp5+RA3kp6Ul2Sl2mzENqXlmfpuIxY 0FEujb3tRTYH1969XJkFVwy2U4Strb2cvnFF4n8dms04KtgGmavSigBsYDnVMpcfa+vDLL HzB2mkvIsA59CtUqiEQIs/NDXLJ7qDgYAlg/iPA4IGzW/0pvsfms21cRXRZryKhB/hifqy T+SDsywqmFhjcDwaLuKFbOpMYudaBZmnpRisoNO+0xkmkEvegGQ5Dsm4Fb2GJw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786001927; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nAE/xtFooaOVhhq6CScA7/gyykvMRWNxvDiW5h0AJ4k=; b=NdsUhc3cs306a3qxUdu349fBmPrLP9Ks0EfI8O4/EBFaxd7JZc/VJlJw6HK6AoOUB3ir+E scV2O0Zs0hSEpIHaftm2jtp4UIgm8iIchS2dPNUP6qWgw0Dpx0blj9NYBqk592QlaSE2O7 00ogU6CCs0Hs/cgJS2v4ZfLPxaV4F7QhUlX/NniL6m1RndLLanYHQwx0EqO1d6R0hblZnt wZxAB26TT1vcerPNqO/FLEGCN8tnAXKLUe9S6hpUmr3MAThxX+QqO2VaSO19lLHnz7gvru HG3zLVrFcjCJrBWLXPens5MPkMc+rqXXR2DCHxqJXvGSCGf8HVX0U/CLBADDnw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hFzfv1g5Tz19fH for ; Thu, 06 Aug 2026 07:38:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 347e4 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 06 Aug 2026 07:38:47 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 985880074211 - stable/15 - pci_iov: Clear NumVFs when configuration fails List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 98588007421144a968f0de4212a803cd0d7e143c Auto-Submitted: auto-generated Date: Thu, 06 Aug 2026 07:38:47 +0000 Message-Id: <6a743a07.347e4.f6f8d07@gitrepo.freebsd.org> The branch stable/15 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=98588007421144a968f0de4212a803cd0d7e143c commit 98588007421144a968f0de4212a803cd0d7e143c Author: Kevin Bowling AuthorDate: 2026-07-28 23:30:28 +0000 Commit: Kevin Bowling CommitDate: 2026-08-06 07:34:23 +0000 pci_iov: Clear NumVFs when configuration fails pci_iov_config() programs NumVFs before validating the final VF RID layout and allocating all generic resources. A subsequent error ran the driver uninit callback but left the hardware NumVFs register programmed while the software VF count returned to zero. Clear NumVFs in the error path after the driver uninit callback, matching normal SR-IOV teardown ordering. This prevents stale hardware state after a failed configuration and permits a clean retry. Sponsored by: BBOX.io (cherry picked from commit 621498b58cdab36a237d5f0b5c902952ad743fa9) --- sys/dev/pci/pci_iov.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/pci_iov.c b/sys/dev/pci/pci_iov.c index 0efcfeac9eff..68b18fc15471 100644 --- a/sys/dev/pci/pci_iov.c +++ b/sys/dev/pci/pci_iov.c @@ -781,8 +781,10 @@ pci_iov_config(struct cdev *cdev, struct pci_iov_arg *arg) return (0); out: - if (iov_inited) + if (iov_inited) { PCI_IOV_UNINIT(dev); + IOV_WRITE(dinfo, PCIR_SRIOV_NUM_VFS, 0, 2); + } for (i = 0; i <= PCIR_MAX_BAR_0; i++) { if (iov->iov_bar[i].res != NULL) {