From nobody Thu Jul 30 01:09:59 2026 X-Original-To: dev-commits-src-main@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 4h9WMX1cS1z6nCdp for ; Thu, 30 Jul 2026 01:10:00 +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 4h9WMX13Fyz3ytf for ; Thu, 30 Jul 2026 01:10:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785373800; 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=MBbzZr1Yo/8uTjZxnOiC9QJfak2Tmg8ed+xdTy4pgng=; b=piaSCtiDfY+7hWLIi0+lcc3HKaXHn+e21JCqVg/w3q1YppWJnWDvpmALs/NOVJjsLRq2xN 2K4+dYojr8cFkPyYG9ioFF/GyX4SP+ycFO2Xv8fAlyTTWcGhXApqotD4SaWe6Q6w/Xwg6C pOOVyEx8S0EvTsbnpv1DgCSbKwf7NOxTGLtCCNhdeKSUt9Cz328EAQTTXjrnzmO0RX2Fn5 aMyC3rp57ElMnnNqmuS8CKHC478U9JbZRN/+6ZfVR9JS9g7GF1Np6tCYkIsNIyf0OXWbyJ B5CPgfKaMwwecxVZx8WFftfphMlnLLMtf+xKWCtumZIM2NzcggDCkopVhggPVQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1785373800; a=rsa-sha256; cv=none; b=kC7gU9Ej8uwhskFOqyp6afYNoVuLlHiQGX2TXVgTUPfrqoqJZYfjITGSKJEl5eeYBMbQx9 d69LzkwLtKqXmc6o+L/0MhHSzYC/rWBOTVcoFAl7eTjXcviVpbP54p6hYfyoG3kTSlC1ic s8UeJOIRB6tSspqhuuauAPxsZRVWw4KwYlSwXIeIK6+KTz3ZrMfFiHxXKC0NuvjaaPQlA7 qW0i9sA+y2ATz6o5AoA9CKVvDgfZTdOz0kg8nyGTnZw1C7vTpB2yaWxFox8IPubsyl6o4E s3FAcc9UjPLXcMZjg/eyoozbhM4itNLpiKbPVhIucVefqp3QqxPqjqzHyV9jLw== 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=1785373800; 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=MBbzZr1Yo/8uTjZxnOiC9QJfak2Tmg8ed+xdTy4pgng=; b=AH7yrFUmNBaCN4DXcPOWq+hA4onYqD4Io+NxLZeOedkZuK4RLsCL1os2vbLya2IExq+dIa Dc56/sRyX1/r46h2NELJ+dhGRglsnZl2oATkAxjulXZBnC4de0INJiTdUcxALKHUioUnBK X8SPVMnBVXPbnyukr5VqphTep+/EuUIu8y2Q8/M3BLQgeTgEWiTNhm+pRuahlQg8jmQRck PIe8DS2P3sYx3pnWmaNCVCAOMzKcaTkYR3DSBG4qVmXMOCSXlS0KR2uFyXveMrPITFChYM 3wUJCix9KAMycgqufj41wGlpaxJJJh4uB4cQS7e+hrt1Ab22ABTiTVMU4znMnA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4h9WMW6zFjzrFw for ; Thu, 30 Jul 2026 01:09:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3f449 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 30 Jul 2026 01:09:59 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 621498b58cda - main - pci_iov: Clear NumVFs when configuration fails List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 621498b58cdab36a237d5f0b5c902952ad743fa9 Auto-Submitted: auto-generated Date: Thu, 30 Jul 2026 01:09:59 +0000 Message-Id: <6a6aa467.3f449.348014c6@gitrepo.freebsd.org> The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=621498b58cdab36a237d5f0b5c902952ad743fa9 commit 621498b58cdab36a237d5f0b5c902952ad743fa9 Author: Kevin Bowling AuthorDate: 2026-07-28 23:30:28 +0000 Commit: Kevin Bowling CommitDate: 2026-07-30 00:43:03 +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. MFC after: 1 week Sponsored by: BBOX.io --- 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 932d83536b7f..643f0e59b9b8 100644 --- a/sys/dev/pci/pci_iov.c +++ b/sys/dev/pci/pci_iov.c @@ -807,8 +807,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) {