From nobody Sat Sep 05 00:30:06 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 4hcDkQ71rzz6qYyG for ; Sat, 05 Sep 2026 00:30:06 +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 4hcDkQ4pmXz414j for ; Sat, 05 Sep 2026 00:30:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1788568206; 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=7Lsgpt/OEHIR5N7a7/U3n3YwsKyowNnWrPJUJIePxR0=; b=Qzp4Rm6xUpPq+a7Yjs8HbxlpgvVAM/9JeQc67GPMiKZfHZJkydITZPJLvhoK/ALxF6HfGB 6cK8Snj1WzVaua30raOmjuVqxH4oP6ZVzCbZjZMu1qpFLAm0p796bR5uZd2hre+Wlb0gSI GlToGGG8Q4ozGofvEV5Gt+xFWh4ahISwKCkMH1cFq+N4tWukctQP6sCX7QXpptSFgJavYp NboJ8h4M+MHwcMFPhlis9S4vrUTtynhpGjNAF3b6hVm9e1fhNHVPS13QkorC9+YnSv2EKp kykKwkkmKwRW7hODkiyNqxtLiIXsja22JQeI3kKOoLKJGMGaysUcRFHfB6vlyA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1788568206; a=rsa-sha256; cv=none; b=G1/HkzR+ULwDmxGJ1H2Gq3ELV3skLzBVQ3iKCVMw3Hd4alT2Y6U1Ox2DxOeeS2VjiEcGgI iQX6LXDBX34RX0tWCsbH90GknkQLke0GJ/W7P+7Bzof5ylbi4tjpfCnHFr6+Gja+w//31B Dm7xyiDHyETh3tDa3KuTPhZsJYwY4dxABqZtofdGJVBZros8FIr5X/PLGF1vwUGl7ga91J PFZtNTfxSt2DJ+P1HJH39WTYtH5NmXAX3bOJqzNMWSuBDfKGiSYlDHcf9wllXt7o2fWjkP vO9ABDDadFlIl0CHntBzyTWwRjuo4mo6GAQRi6cG+SZ/ge5D48ejerdRm702KA== 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=1788568206; 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=7Lsgpt/OEHIR5N7a7/U3n3YwsKyowNnWrPJUJIePxR0=; b=qpUISwQaOu4eTiW1xQ+I6qYm5T47vOHob36ECl6Toa0iyHz72bzYjMWJ/b5KGitzO0Fkg4 gwIqBOz6NkF4H4lhMH4jdL2dz8d30/+wSP2FjsTJs470+ZCpxSfdnPunIvpvzJETEjhKdj f/ObHVjJ+GUOZt5liKr5cjX8cWX/Tr3Zhimp78PSmaQ+frdb5FbZP/Z/tQ5AmIdzh91yJ3 txVg/IA0n6N/aArps7GE4yDshZkmK2kuLgBV296+P4mR+WfSNng0ZoBg8O7Ra7ukH1yuAM Mb5SERRdoCDECrmXq46D0cztl+L+O4DwFG6IeHB8D1UecYX/Xv5xO4xUw/vwKg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hcDkQ2rYdz7JJ for ; Sat, 05 Sep 2026 00:30:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1f224 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 05 Sep 2026 00:30:06 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 985a4791a80c - stable/15 - ofw_pcibus: Inherit PF locality for SR-IOV VFs 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: 985a4791a80c433ebd211e5e0aadbf109df11e1f Auto-Submitted: auto-generated Date: Sat, 05 Sep 2026 00:30:06 +0000 Message-Id: <6a9b628e.1f224.1ef543f0@gitrepo.freebsd.org> The branch stable/15 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=985a4791a80c433ebd211e5e0aadbf109df11e1f commit 985a4791a80c433ebd211e5e0aadbf109df11e1f Author: Kevin Bowling AuthorDate: 2026-08-21 02:45:33 +0000 Commit: Kevin Bowling CommitDate: 2026-09-05 00:29:04 +0000 ofw_pcibus: Inherit PF locality for SR-IOV VFs PCI VFs are allocated dynamically and have no corresponding OFW node. The zero-filled OFW PCI devinfo currently leaves obd_node as 0, which is not the invalid-node sentinel and can send NUMA lookup through an unrelated firmware node. Initialize dynamically allocated devinfo with an invalid OFW node. For VF locality queries, use the owning PF's node when it exists. Fall back to the PCI bus when neither the VF nor PF has a firmware node. This preserves existing CPU-locality behavior for ordinary PCI devices while making VF domain and interrupt placement follow their PF. Reviewed by: PowerPC (jhibbits) Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59064 (cherry picked from commit f003e86335c9c16c6769ef8f0c091d425dba7ef9) --- sys/powerpc/ofw/ofw_pcibus.c | 39 ++++++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/sys/powerpc/ofw/ofw_pcibus.c b/sys/powerpc/ofw/ofw_pcibus.c index 22a1634a0389..2c759f35cb69 100644 --- a/sys/powerpc/ofw/ofw_pcibus.c +++ b/sys/powerpc/ofw/ofw_pcibus.c @@ -156,6 +156,7 @@ ofw_pcibus_alloc_devinfo(device_t dev) struct ofw_pcibus_devinfo *dinfo; dinfo = malloc(sizeof(*dinfo), M_DEVBUF, M_WAITOK | M_ZERO); + dinfo->opd_obdinfo.obd_node = -1; return (&dinfo->opd_dinfo); } @@ -381,13 +382,31 @@ ofw_pcibus_get_devinfo(device_t bus, device_t dev) return (&dinfo->opd_obdinfo); } +/* Return a VF's owning PF node, or -1 if none is available. */ +static phandle_t +ofw_pcibus_get_pf_node(device_t child) +{ + device_t pf; + + pf = pci_iov_get_pf(child); + if (pf == NULL) + return (-1); + return (ofw_bus_get_node(pf)); +} + int ofw_pcibus_get_cpus(device_t dev, device_t child, enum cpu_sets op, size_t setsize, cpuset_t *cpuset) { + phandle_t node; int d, error; - d = platform_node_numa_domain(ofw_bus_get_node(dev)); + node = ofw_pcibus_get_pf_node(child); + if (node == -1) + node = ofw_bus_get_node(dev); + if (node == -1) + return (bus_generic_get_cpus(dev, child, op, setsize, cpuset)); + d = platform_node_numa_domain(node); switch (op) { case LOCAL_CPUS: @@ -410,17 +429,23 @@ ofw_pcibus_get_cpus(device_t dev, device_t child, enum cpu_sets op, size_t setsi } /* - * Fetch the NUMA domain for the given device 'dev'. + * Fetch the NUMA domain for the given device 'child'. * - * If a device has a _PXM method, map that to a NUMA domain. - * Otherwise, pass the request up to the parent. - * If there's no matching domain or the domain cannot be - * determined, return ENOENT. + * VFs have no firmware node, so use the owning PF's node when available. + * Otherwise, pass the request up to the parent when the device is not + * represented in the firmware tree. */ int ofw_pcibus_get_domain(device_t dev, device_t child, int *domain) { - *domain = platform_node_numa_domain(ofw_bus_get_node(child)); + phandle_t node; + + node = ofw_pcibus_get_pf_node(child); + if (node == -1) + node = ofw_bus_get_node(child); + if (node == -1) + return (bus_generic_get_domain(dev, child, domain)); + *domain = platform_node_numa_domain(node); return (0); }