From nobody Wed Mar 18 19:11:14 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 4fbdhy6bbTz6WBwk for ; Wed, 18 Mar 2026 19:11:14 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fbdhy644Jz3M44 for ; Wed, 18 Mar 2026 19:11:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1773861074; 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=X8jRccIjrJ1gePIIbuVT/H2dqb6GbzEB+4LdA6h8JuI=; b=MHS7moYFKE4HuFcuDc8ZvDt1AyrgZ7AKFhyAMHIVjvG/kfBn9zGHoOayIF7TOlL2+d0Dyl GICFwGSeH7DqnqGdroWOsZ4d04dlu2RBD73eMARfQvah2VAI3yt5z5sv4lzMPqkNt/hCAx u7SrqwHQ9QRp7tlROV1vwC1rJrL1ESAr2SQxOKacb8TCf63T2BDMEJfNdSMgbFRcNy0KsI M61uYifJl8DqilkD8CasuaquiWXr9rZq4llbPMP3pKnQj6iP9VS8Y/+ZmqK9AEp+ABLMHn Xr7eWauNGvf2y7IHwhlqiPERkqKTBEemOUXVQuE88BTFL4m5uQWcB9sSDF0f5w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1773861074; a=rsa-sha256; cv=none; b=RNnixuZzTZBnJvmPyFRZQHY8+O6r7yhHCvrAd4Zl46d26pJkw2d3otVEnbxY9zRmFhNBRX B4tELkJrLYjQKQTWeaQoBJRqyRU+S78gX+Il5HwNkd9tL6lN85kvghmrXWA2aPECzyDtvn 9X/Bab/LEko/GKtL84xbZChoEnhpUazY44hQMePlXv3MzmtcpQnC9dkY3B2LJD2Esin6rO +XUVva0MbvV7+auMhjlf1eWTsrYPxrsn+XmQvUALM6diCFYSJZawTp0wp7wzRWO2b5tpZi 9yKycn6NHIm29XfRjeWcIDMExDXnVUA4849OhakPdwt8sXF9n0UIrDBPQJYRbA== 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=1773861074; 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=X8jRccIjrJ1gePIIbuVT/H2dqb6GbzEB+4LdA6h8JuI=; b=eHYc5Iq0+WBR3oztJjV46NfCug/kmuhIYAs2bSPwdB9BfRDLK8pTmT8uOMrkjBsbC+C00b YfFsZH8DK4IYxK0+O8vsVOZRqlFh8g7KkjF3GfVLC62N2t4RFIbj2hUqSUNB7nMoyV7sAc FbIWbIipbrgtwICVPMMQJe9yvZr1UEDejwvruaresHQdtRGDKoMInM+7AwDG7Q91FD4mte LDtDm33PJw3mQcACsUpKmWpRArgU46PCF2gRv0pMXuQAomr1ZM35lwjrhCTKzJZTdsuDoh Q1lDOalZ6AGaTsQUrkD4TEaZVZbprpWCGnubElQIciWwryfIlzu9iMBwUqN2UA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fbdhy5gDxz5xL for ; Wed, 18 Mar 2026 19:11:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3891e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 18 Mar 2026 19:11:14 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: c25839cda69f - stable/14 - intrng: Shuffle unhandled interrupts too 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c25839cda69f5c207b7685ec25a32a67914b0708 Auto-Submitted: auto-generated Date: Wed, 18 Mar 2026 19:11:14 +0000 Message-Id: <69baf8d2.3891e.67a908ad@gitrepo.freebsd.org> The branch stable/14 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=c25839cda69f5c207b7685ec25a32a67914b0708 commit c25839cda69f5c207b7685ec25a32a67914b0708 Author: Colin Percival AuthorDate: 2026-02-14 00:35:26 +0000 Commit: Colin Percival CommitDate: 2026-03-18 19:10:42 +0000 intrng: Shuffle unhandled interrupts too When interrupt vectors are first allocated, they get assigned to CPU #0; at SI_SUB_SMP / SI_ORDER_SECOND (aka once we have multiple CPUs), the intr_irq_shuffle SYSINIT clears their CPU sets with the effect of forcing them to be assigned to new CPUs later. In case where interrupt vectors were allocated *but not yet bound* this code did not run, with the effect that those interrupts would remain pinned to CPU #0 forever. This affected the ena(4) driver, which allocates interrupts for I/O when the device is attached but doesn't set them up until the interface is brought up much later in the boot process (and, crucially, long after intr_irq_shuffle runs). Adjust intr_irq_shuffle to clear the CPU set for an interrupt source even if it currently has no handlers, so that it will be properly assigned to a CPU when it is used later. Reviewed by: andrew, mhorne MFC after: 1 month Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D55284 (cherry picked from commit b2ba4131b9b08d6231392c0b798d0ff35809f600) --- sys/kern/subr_intr.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/sys/kern/subr_intr.c b/sys/kern/subr_intr.c index 6198603adfe8..d63a0e3629c5 100644 --- a/sys/kern/subr_intr.c +++ b/sys/kern/subr_intr.c @@ -1271,10 +1271,22 @@ intr_irq_shuffle(void *arg __unused) irq_assign_cpu = true; for (i = 0; i < intr_nirq; i++) { isrc = irq_sources[i]; - if (isrc == NULL || isrc->isrc_handlers == 0 || + if (isrc == NULL || isrc->isrc_flags & (INTR_ISRCF_PPI | INTR_ISRCF_IPI)) continue; + /* + * We can reach this point with isrc_handlers == 0 if a + * driver allocates interrupts but does not set them up + * immediately; for example, a network driver might + * postpone calling bus_setup_intr on I/O IRQ(s) until + * the interface is brought up. + */ + if (isrc->isrc_handlers == 0) { + CPU_ZERO(&isrc->isrc_cpu); + continue; + } + if (isrc->isrc_event != NULL && isrc->isrc_flags & INTR_ISRCF_BOUND && isrc->isrc_event->ie_cpu != CPU_FFS(&isrc->isrc_cpu) - 1)