From nobody Sat Sep 05 00:31:18 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 4hcDlq0rFXz6qZNd for ; Sat, 05 Sep 2026 00:31:19 +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 4hcDlp75l3z42PM for ; Sat, 05 Sep 2026 00:31:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1788568279; 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=cm05Cv3YHm+TTpc1EAffLPCBACDeD2Idb+sdi3Pc6PA=; b=fgAXtUFvRi8JK/WYlNbEf/h/Iux1djbwpnTh9rAcfjdVrCRHsn+LDxqgbuP4UhEfYzF8Hm 84Ul74g+maTFUhRVtAH/z8pgMK2rsRliUT2v6smimst2Za4KrDAV1ZXy3q2wa8IZW+OP32 mOE+netJ5rOSGas1/W8ZRevjlVAx92CahVb5iGWUtVxnZTTlSViICtJwkTOYa649ElNHTQ UUIWci0BM/tgnMAShg3qraWaawCB06/gMyIspCPYFURvEAvv0bAPjuQSFMWkcGYoMqu/LS y4AnrLfPK+/ALFkSuFCzRKJv9UsO42Tq+C2IRzErBXlV8f/gZDoC1xq/eJVHRg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1788568279; a=rsa-sha256; cv=none; b=wR4WVDvPeocFnDrGgKvsSxGRzqj7Vt5Jtii9ltaGIBf8sc8BmuE8oMbw+7oHyREcXcprAA hMfet5DV7ZYD7z9C6cvlFbgCMTCKB1Tb6NP7lf+nYl1hgSMC5HFeVBRL+IKpzHy452Ipts pjC/1VbZtVFV4rKWlh7LeGblHlOqNTSiTT5MBINkKDY7TZ0tNnDSzeeX9G4wQMa2Gw0+Dx V0WS8n+cqc/uPz3UL3jQF9JOkOnzb9Npc0ti6hJm7wj0qB6QQfjdVUIUQFHsAlsdwDSpBB FcfQ8zJCHh+vdbI6xWQeWkqrPSXAFUszwgk/KPfZlzfFDIxrWHkmLx7aQiYv4A== 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=1788568279; 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=cm05Cv3YHm+TTpc1EAffLPCBACDeD2Idb+sdi3Pc6PA=; b=oYVlAE29JvoaGzI2DmQFdr8QBja2I+x8nXk3hYuybIKmwRUysjsRnUvvPHaLqfw59tM726 GB8EUcDATnzn+luj+DSPre31hOwB1x2j78O8MOtehslFc5Q5WwV1CbHDkdHci7ICYIu9Bb TH+FFLrvyHWTDwYk/epPzOK4CXYUp85+b9eeYnZkX8fZfA6VYlF/XQZuslHOnLP7Q5iJRw ZfSoW3cXklzY5L7S9Tz6Lw7963u/7KI8ebokqL/qm1BllHVEXNiQg6zNC2DN+TXEgdKKQU fU7MD/Z+g/+o1xZGgHSkYsn17QLCGL3wNqEAnJsl9OGMvFEOcxlHqnqVbsh2aQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hcDlp5l10z7j6 for ; Sat, 05 Sep 2026 00:31:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 20386 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 05 Sep 2026 00:31:18 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: c58ec93eee8d - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: c58ec93eee8d5300959b84525b82c76826b586e0 Auto-Submitted: auto-generated Date: Sat, 05 Sep 2026 00:31:18 +0000 Message-Id: <6a9b62d6.20386.16464936@gitrepo.freebsd.org> The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=c58ec93eee8d5300959b84525b82c76826b586e0 commit c58ec93eee8d5300959b84525b82c76826b586e0 Author: Kevin Bowling AuthorDate: 2026-08-21 02:45:33 +0000 Commit: Kevin Bowling CommitDate: 2026-09-05 00:30:27 +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 2a3ddfe6e24c..cd1f0bd09483 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); }