From nobody Fri Aug 7 13:46:42 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 4hGlmy2lzrz6n712 for ; Fri, 07 Aug 2026 13:46:42 +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 4hGlmy2Cdlz3KYj for ; Fri, 07 Aug 2026 13:46:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786110402; 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=hz2jWNbhQ4AWHOmaGaiZYmO3pWSpFkX0bsh8S8q6Uuo=; b=F2i+PsjyrCpNg2VvKFl3hi6RxFZRXsGN4gysXBjT/y7Nykz/5tqOMkE9b1aZSqr7vFlLP0 OB15QF+/6smGXby7D4fEbGUYbfBZErTCv5A3RD5wCyqKk9tbvDL8yrChX6FR7/6ySBpOgN Z/3nIeLgAsDbm4YiyPw6G7T+pka58WaK5hqZ8nOJC3ypi+aJZPtXnV+83FPkePtetehDC+ T6pPy46mFu27mjmgwB0S1qenZWJ5HWq7fErEsnrPRtlUcmSlSG1+pG/JT9r/qDOvl+QgOY R/8ZnJfQl/d+xZs2xxil3G0+Yw2ZD+ZqIrmqIftCaGAmwXgMj1szE4l4Djukjw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1786110402; a=rsa-sha256; cv=none; b=CoJZwWpeRCxIaKDzoueFI3p2JQComlrjZPvw4mgMq5gePfmkg+3sW55eGZqM74x+Rr7XWp udC8htz+vCAk6qoWoaAjR5I+Vn4DiDuB4AaTGzmSelqSOkQHEJzDWlUpTVxg1oJjifCeeB eekCVgfuVOiPMR2tJRyrVFBe5H4MK7nVnhDc4dHGHGENi6amTTWPumFfkue1g0ICFHpBjK qKnNv8CSo7e+2NUK5fidCD0kbdMM7Hx5p5eUMj5OXzom0qapzDJcgpi3XFsRjHkvFU7Fag Cm6bV14ZrPl/KjjLQEPwN/as0HNsNnnNZshF8lIQbu4aSjUT9D67s7ueDSD6Lg== 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=1786110402; 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=hz2jWNbhQ4AWHOmaGaiZYmO3pWSpFkX0bsh8S8q6Uuo=; b=qiePegS6VsFc6DQDgZx4hD4SVMpbGkV+F20dw4V80pJUQtACQ30aJByaSGGStTN2jUz08q V2K7OuQVT1RyNuF9EQMsgyo6XYlUQeqHMFOfsSe2pT/rbcAFfN/rKVRMtTAVYsqwUvBXtz Nf/BnYuDIna82DmG23kGYPvehM2alOF6jXYJNv9Vt1xckAK36/cUy+F6+TeqBacRZX2KjN 4O3RyH6/GvbFr0OPcTygJgm33h8UOits1ud4R7xj2A+JpYm2qvJl1ZvG/6jvLjKlr3fmwR TIAo7i05tbHm7LyXDmHxTblcSspw6XFi9uk1IHUiKljnBWOEeHTzCa09VBcfhg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hGlmy1CRjz18B8 for ; Fri, 07 Aug 2026 13:46:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3fc40 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 07 Aug 2026 13:46:42 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 78547d542f77 - main - pci: Skip PF SR-IOV state handling for VFs 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: 78547d542f776d366c36b5a2fc747ddfe99523c6 Auto-Submitted: auto-generated Date: Fri, 07 Aug 2026 13:46:42 +0000 Message-Id: <6a75e1c2.3fc40.28d9dda8@gitrepo.freebsd.org> The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=78547d542f776d366c36b5a2fc747ddfe99523c6 commit 78547d542f776d366c36b5a2fc747ddfe99523c6 Author: Kevin Bowling AuthorDate: 2026-08-07 13:30:06 +0000 Commit: Kevin Bowling CommitDate: 2026-08-07 13:46:35 +0000 pci: Skip PF SR-IOV state handling for VFs A VF's pci_devinfo references its PF's pcicfg_iov for resource bookkeeping, but only the PF implements the SR-IOV capability. pci_cfg_save() and pci_cfg_restore() treated any non-NULL cfg.iov as an owned capability and accessed the PF capability offset in VF configuration space. Saving a VF could therefore replace the shared PF settings with unrelated VF register values. Skip SR-IOV capability save and restore for PCICFG_VF children. The generic PCI and PCIe state of the VF remains preserved. This is also required by drivers that save VF state around a PF-driven function-level reset. MFC after: 2 weeks --- sys/dev/pci/pci.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index 749ee71b195f..83ea487bdaa5 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -6691,7 +6691,9 @@ pci_cfg_restore(device_t dev, struct pci_devinfo *dinfo) pci_resume_msix(dev); #ifdef PCI_IOV - if (dinfo->cfg.iov != NULL) + /* The SR-IOV capability is implemented only by PFs. */ + if (dinfo->cfg.iov != NULL && + (dinfo->cfg.flags & PCICFG_VF) == 0) pci_iov_cfg_restore(dev, dinfo); #endif } @@ -6807,7 +6809,9 @@ pci_cfg_save(device_t dev, struct pci_devinfo *dinfo, int setstate) pci_cfg_save_pcix(dev, dinfo); #ifdef PCI_IOV - if (dinfo->cfg.iov != NULL) + /* The SR-IOV capability is implemented only by PFs. */ + if (dinfo->cfg.iov != NULL && + (dinfo->cfg.flags & PCICFG_VF) == 0) pci_iov_cfg_save(dev, dinfo); #endif