From nobody Sat Sep 05 00:30:09 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 4hcDkT6KNjz6qZ0W for ; Sat, 05 Sep 2026 00:30:09 +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 "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hcDkT58Whz41PQ for ; Sat, 05 Sep 2026 00:30:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1788568209; 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=1w5UtrpGkv4Dgn0Iqt/W0tk8muEZUipfploWU4ANVCA=; b=CuP1lX7BKM8lFru1/vfJYnzKssyxOWry/M0xYvRMdSsuV0n9GJbQBCWmeuXCpghwNV1agg tC1ZPQ0v20EVBAI/csDBOlWudmMA9wj4cOS8rffbLMT6NHh78+d/2YwZ/KB09J5l0IYpsZ nQbd7hFFNwpfPaBhza7SKL4dCJJshy9VC4WDPzwY50qssZaHLVRw5eDln1gBdtQl8avfEh WOd3J7MYUkUc5utpUNRPhPJcfHOHRlxWyrjT4tVup+OGAf/domaux8gwNSd31pzgkSwwTI y7YDuCZvYQi9EZepemQWZqp6KHr9wpUZjnyXGQu0uoInMmcj3gYJBqb8Ld2/fA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1788568209; a=rsa-sha256; cv=none; b=te+srkS+okoFTqzc48DuBeLOYKCOhaEJrNGJs8otWtFjcHOCEevF1aDu9JWHT0pfPiMyyf SCsc8rVOAJ0c4ZZOQQSVZ8XA01H2/cCZ6dkbRQs0TdvBuo3dYl/bAS5deN29ybgXFpT3nI ClK3TZLKSrllwn+Zq+65wiVrjEzDpt4XdToYvIG4qcyZKBLly8KTPIcT27CigE/pT1E4yB Z3Ix6/yRW0zAmmuYSTVL+VXve37716PRiy+75fFdPCuU9oO+zOZ0qMxVSmgYrAHY+iz4Da +281gtqedyDl5ShA5gudR7cCabJxbZnqQKAh1KxdvSFmDPjl7sjlRDzKDDS2bQ== 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=1788568209; 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=1w5UtrpGkv4Dgn0Iqt/W0tk8muEZUipfploWU4ANVCA=; b=KGXxEMBd04n6jbAq+HQSS6RflsMywQVzQzjlF6Fyc7ImpqlU2EsslsZ8SCHnViiUsIOmOT pm8N7AkMKhR1nl5FZqHstrX4UXAuXjKBTqLUNEbmx0yC+CMR3CRViK2sE1xtqIufFauDuu Vlq5c7yUQRcy3wV2yLl4tTjDww+vztEQ45CGU/b7nAWPQ8ARe6Lj8TEy7A8TPzAljZANd9 HiepJVExQKvAirM8VMGnJoqMLn7btmKWTxfWLcSuQl+3ijEWgtnHWO1AByH9O3tHsTAld+ 7oV807yW66CSHbGdERlEJWdbrb0rTB+ZvmBLK2m0Uq8lqThFdMsokxaStlXZOA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hcDkT46J5z7fw for ; Sat, 05 Sep 2026 00:30:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1d7fb by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 05 Sep 2026 00:30:09 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 23621baf099d - stable/15 - pci: Expose a VF's owning PF to bus subclasses 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: 23621baf099d7ace6cb6445cab9ca6a811f25e80 Auto-Submitted: auto-generated Date: Sat, 05 Sep 2026 00:30:09 +0000 Message-Id: <6a9b6291.1d7fb.406003fc@gitrepo.freebsd.org> The branch stable/15 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=23621baf099d7ace6cb6445cab9ca6a811f25e80 commit 23621baf099d7ace6cb6445cab9ca6a811f25e80 Author: Kevin Bowling AuthorDate: 2026-08-22 03:14:37 +0000 Commit: Kevin Bowling CommitDate: 2026-09-05 00:29:55 +0000 pci: Expose a VF's owning PF to bus subclasses ofw_pcibus now uses pci_iov_get_pf() to inherit PF locality for VFs, but the accessor was inadvertently left in an uncommited ACPI change. This breaks powerpc builds. Expose the accessor from the PCI core and provide a stub when PCI_IOV is omitted. Record VF ownership before pci_add_child() so child added callbacks can safely query it, and remove the later redundant assignment. Sponsored by: BBOX.io (cherry picked from commit 3481a9cdc4dc26ef583bb0f46a04d5d059cde466) --- sys/dev/pci/pci.c | 25 +++++++++++++++++++++++++ sys/dev/pci/pci_iov.c | 1 - sys/dev/pci/pci_private.h | 1 + 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index a4518e9ad631..16d84d110c5e 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -4415,10 +4415,23 @@ pci_rescan_method(device_t dev) } #ifdef PCI_IOV +device_t +pci_iov_get_pf(device_t dev) +{ + struct pci_devinfo *dinfo; + + dinfo = device_get_ivars(dev); + if (dinfo == NULL || (dinfo->cfg.flags & PCICFG_VF) == 0 || + dinfo->cfg.iov == NULL) + return (NULL); + return (dinfo->cfg.iov->iov_pf); +} + device_t pci_add_iov_child(device_t bus, device_t pf, uint16_t rid, uint16_t vid, uint16_t did) { + struct pci_devinfo *pf_dinfo; struct pci_devinfo *vf_dinfo; device_t pcib; int busno, slot, func; @@ -4430,6 +4443,11 @@ pci_add_iov_child(device_t bus, device_t pf, uint16_t rid, uint16_t vid, vf_dinfo = pci_fill_devinfo(pcib, bus, pci_get_domain(pcib), busno, slot, func, vid, did); + /* Make the VF-to-PF relationship available to child-added callbacks. */ + pf_dinfo = device_get_ivars(pf); + KASSERT(pf_dinfo->cfg.iov != NULL, + ("SR-IOV PF %s has no IOV state", device_get_nameunit(pf))); + vf_dinfo->cfg.iov = pf_dinfo->cfg.iov; vf_dinfo->cfg.flags |= PCICFG_VF; pci_add_child(bus, vf_dinfo); @@ -4443,6 +4461,13 @@ pci_create_iov_child_method(device_t bus, device_t pf, uint16_t rid, return (pci_add_iov_child(bus, pf, rid, vid, did)); } +#else +device_t +pci_iov_get_pf(device_t dev __unused) +{ + + return (NULL); +} #endif static int diff --git a/sys/dev/pci/pci_iov.c b/sys/dev/pci/pci_iov.c index 9fb93f3db114..6497a5599257 100644 --- a/sys/dev/pci/pci_iov.c +++ b/sys/dev/pci/pci_iov.c @@ -664,7 +664,6 @@ pci_iov_enumerate_vfs(struct pci_devinfo *dinfo, const nvlist_t *config, vfinfo = device_get_ivars(vf); - vfinfo->cfg.iov = iov; vfinfo->cfg.vf.index = i; pci_iov_add_bars(iov, vfinfo); diff --git a/sys/dev/pci/pci_private.h b/sys/dev/pci/pci_private.h index a5cab7d1e181..80430ac47f56 100644 --- a/sys/dev/pci/pci_private.h +++ b/sys/dev/pci/pci_private.h @@ -118,6 +118,7 @@ void pci_add_children(device_t dev, int domain, int busno); void pci_add_child(device_t bus, struct pci_devinfo *dinfo); /* Call after cold enumeration and before attaching the bus's children. */ void pcie_reconcile_link_mps(device_t bus); +device_t pci_iov_get_pf(device_t dev); device_t pci_add_iov_child(device_t bus, device_t pf, uint16_t rid, uint16_t vid, uint16_t did); void pci_add_resources(device_t bus, device_t dev, int force,