From nobody Thu Aug 6 07:40:58 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 4hFzjX5B46z6p2S8 for ; Thu, 06 Aug 2026 07:41:04 +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 4hFzjR0HZPz3G4x for ; Thu, 06 Aug 2026 07:40:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786002059; 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=l67LZXluWxsqNPX0mP9/Q4jyKBbusBHU5VlyMLOsd9w=; b=hgs/vjoLkShz2w7qJeizUg5Dq/fFWvyDsTobKd8DNnKm4aP1yMoOyVE7gaoHpDAHu3Y2XX STsbIBppJoDqkTgZhINdoChe7v046QkUjmtSwEQxoTmQ2cnID/l31kWHI1qblYKM48I5ZO VC/KUVqkOoCHQeWiRdvRryMCd4I27ookG6Qq3OEXxpD+uM9QPtoKlZ2i+R6DNdeK4ca4// OizromKP/mcUhHl/qukW8idT5LNaF9S/X0SwR2qSo87qG1/4ELYk7xsenoX6f0C46qRrS2 +GhkVjq33VhgRkk5px6LNG7ez4qy2SpmCUjB/AeDuqDAgCReGpZTruOGmQnzOQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1786002059; a=rsa-sha256; cv=none; b=gJ6MAusEPbtY2OXy2Jerui/5RjB5may+FDnNdAy8FQfTAdkwPc7QfDNf4wXi/tzuH7ztxm haPIG5lQhtqOAkuMi/5KLrmF68avgSkoOtAjIXpq5bapNKTJBo8RhqhRJuz1lolBUCB1Ir 3eVF2Zh8edu74gFADHySS4MgrUsWfRbEOjihuf3EpLyRIL8saHHZ0AbgJg4n9Bl5ISMSnB JrnU+84ZRMxJ8pBp+EPIe3ewtgxk1zsfx3tTeNkaECwnk99Vsz4ptvl3HaKWWxfFKOVtn6 n0ua+Mwz1UIAYqWoAmcbvco90OacSpREMxaqePrpDLR9lx+4qA3RX/lY5S0Zdw== 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=1786002059; 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=l67LZXluWxsqNPX0mP9/Q4jyKBbusBHU5VlyMLOsd9w=; b=XIllRJIiXjSCN55qgV6VrODwKiQGZJivzHZeY8ZhZtuDyiuyCZGQ8X40aUDLAL0SfKniHS Ya/8KDAYli4iQRX/KxTsrGJ8eWkJpGfKDo8Xj07YdYyvuRwD56T3GEG6QksWEEU8CwNqzO nchEPRCPMSlGdiIU67lYE2cDzBYqIRWZsn87Nu3apSzTvTVkxGqNkE5C/Ff+7JaOe97zwx DSIlxwgjwDuvykjM6npeVrsGsTd6UKaLUMon1enZ7MUVFEaM5MUT4WjR877+6AhWKY+0YL K6QGVRKTUkqG1dFG6MW9/TOSuWbDfUM1FM1Z2rV+u6jlpEuoNP4lhayF8XYytA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hFzjQ6Nh3z19hV for ; Thu, 06 Aug 2026 07:40:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 369db by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 06 Aug 2026 07:40:58 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 799f8ebd69fd - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: 799f8ebd69fd0af7c38cf3729eaab50a54821529 Auto-Submitted: auto-generated Date: Thu, 06 Aug 2026 07:40:58 +0000 Message-Id: <6a743a8a.369db.a0fe207@gitrepo.freebsd.org> The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=799f8ebd69fd0af7c38cf3729eaab50a54821529 commit 799f8ebd69fd0af7c38cf3729eaab50a54821529 Author: Kevin Bowling AuthorDate: 2026-07-28 23:30:28 +0000 Commit: Kevin Bowling CommitDate: 2026-08-06 07:39:10 +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 920d13e99ea0..ecae70ca0d4a 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) {