From nobody Thu Aug 6 07:38:47 2026 X-Original-To: dev-commits-src-all@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 4hFzg11w91z6p29c for ; Thu, 06 Aug 2026 07:38:53 +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 4hFzg02vlYz3Dby for ; Thu, 06 Aug 2026 07:38:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786001932; 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=Nb/mXW6Z+qPUm/l4UOLqkZcQuJ8tlnyfEuEtVkJ92DvLWhdnSQcflq9lCCybGfT+mxKy10 Vbts2UJHwfg+LosKIorlE1KU0wuvahLE3SKuqyB//y7NNDKs/rUENtQMXcIu2unJ8J2NPt YAKrP/YNEfJ6NKdZVfwMXItITCY2crYA4TX94M0CUFXcs5eQ4gqcVfIOB90EuoDtF559hv toJiWYXpGLoAdZ/lfDnUYLmG+is+0Jgl6COdFPbDMskAPvvGW0qMVoXZE1LVeadrWoyhir zxEcgxiZJVWaTFC+fBX3NIwwUHctwEYrmcfr4YHUv00mPInCR3juLPj+Bk5n4w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1786001932; a=rsa-sha256; cv=none; b=Bnc3ePWgSJFluQz9+4AEgIxWFs4js3dSQS/ydliCW+R7yyV9CmOYvIik7sOwiTqGduo3Qf gGp7TKq8tYTJQUaNe0MOPYL7TJie966Df8ox+THiSk9cJiO2BO58afF/6CIecxvc/nNiKm 4sA2vKcXYoZP/TyNOBJHhj2ycfgPj119JVALodf8NsT7t19epEMWhfutIIBCNyvMFof3mb RKIx1cSc/mrmsaWoDJoRU+80bsZxVgB4i5NMvHxLifa0H5L6gmFxR9iAKdNVBhsuT4S9Yc bweqObHbYQbvDtJxNo215UIbBofPxhwthl+mr2+vxImC5wcp3unCaIsnJF7x0g== 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=1786001932; 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=KH9P5y8gNJTBM5GmiZaTdZtemWiectCPXE8jXpZDJYFieB+Sel+6r834Vw+W3vWbm2Lxdh zZlCevWTCQo/TYVkERtIOeZ0t51vRIITuCWvHupDdcdPV0pqQCM0sNkH+pFRRs8pMF5Sup EvNVmEFTLbaJ2edibnXKC6lbnw1L1OD+UHj74aZBc0IuwtQN6x10WeTzir+LfxaeXkW5VN PoM4RG+vDQGtvsyUkYO0e4KrJN0+6FwEYmdXlOQA6q7nOXMgv2IthIndUvXc/t7Rqy8WLM WwbB1o9bwX6y6fADm8Bj7iTldD+K8Ql1/6QmxQr8Jk5GQ5f/xKc7sSNWDL5i9Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hFzg01r73z18x2 for ; Thu, 06 Aug 2026 07:38:52 +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: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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) {