mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Josua Mayer <josua@solid-run.com>
To: "Ioana Ciornei" <ioana.ciornei@nxp.com>,
	"Christophe Leroy (CS GROUP)" <chleroy@kernel.org>,
	"Andrew Lunn" <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Horia Geantă" <horia.geanta@nxp.com>,
	"Pankaj Gupta" <pankaj.gupta@nxp.com>,
	"Gaurav Jain" <gaurav.jain@nxp.com>,
	"Herbert Xu" <herbert@gondor.apana.org.au>
Cc: Yazan Shhady <yazan.shhady@solid-run.com>,
	 Jon Nettleton <jon@solid-run.com>,
	linux-kernel@vger.kernel.org,  linuxppc-dev@lists.ozlabs.org,
	linux-arm-kernel@lists.infradead.org,  netdev@vger.kernel.org,
	linux-crypto@vger.kernel.org,  Josua Mayer <josua@solid-run.com>
Subject: [PATCH RFC net-next 3/3] soc: fsl: dpio: skip isolated CPUs when assigning portals
Date: Wed, 30 Sep 2026 18:55:00 +0200	[thread overview]
Message-ID: <20260930-dpaa2-isolcpus-v1-3-66c13f4fd75b@solid-run.com> (raw)
In-Reply-To: <20260930-dpaa2-isolcpus-v1-0-66c13f4fd75b@solid-run.com>

During probe, each DPIO object is assigned to exactly one CPU, and its
interrupt affinity is set accordingly. CPUs are picked from all online
CPUs, regardless of CPU isolation.

The dpaa2-eth and caam qi2 drivers use one DPIO per CPU and follow its
affinity: notifications from each DPIO and the matching NAPI polling are
handled on the DPIO object's assigned CPU.

When isolcpus=managed_irq is used to reserve CPUs for latency-sensitive
applications, those CPUs are expected to be free of routine device
interrupts. However, DPIO interrupts currently continue to arrive on
isolated CPUs.

Restrict the CPUs available to DPIO objects to the online CPUs in the
HK_TYPE_MANAGED_IRQ housekeeping mask, so that isolated CPUs are skipped
and left to the applications pinned to them.

Signed-off-by: Josua Mayer <josua@solid-run.com>
---
 drivers/soc/fsl/dpio/dpio-driver.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/soc/fsl/dpio/dpio-driver.c b/drivers/soc/fsl/dpio/dpio-driver.c
index d5198ffc44550..242db78affb95 100644
--- a/drivers/soc/fsl/dpio/dpio-driver.c
+++ b/drivers/soc/fsl/dpio/dpio-driver.c
@@ -13,6 +13,7 @@
 #include <linux/dma-mapping.h>
 #include <linux/delay.h>
 #include <linux/io.h>
+#include <linux/sched/isolation.h>
 #include <linux/sys_soc.h>
 
 #include <linux/fsl/mc.h>
@@ -173,7 +174,7 @@ static int dpaa2_dpio_probe(struct fsl_mc_device *dpio_dev)
 	/* get the cpu to use for the affinity hint */
 	possible_next_cpu = cpumask_first(cpus_unused_mask);
 	if (possible_next_cpu >= nr_cpu_ids) {
-		dev_err(dev, "probe failed. Number of DPIOs exceeds NR_CPUS.\n");
+		dev_err(dev, "No unused managed_irq cpu left for dpio\n");
 		err = -ERANGE;
 		goto err_allocate_irqs;
 	}
@@ -317,9 +318,11 @@ static struct fsl_mc_driver dpaa2_dpio_driver = {
 
 static int dpio_driver_init(void)
 {
+	const struct cpumask *hk_mask = housekeeping_cpumask(HK_TYPE_MANAGED_IRQ);
+
 	if (!zalloc_cpumask_var(&cpus_unused_mask, GFP_KERNEL))
 		return -ENOMEM;
-	cpumask_copy(cpus_unused_mask, cpu_online_mask);
+	cpumask_and(cpus_unused_mask, cpu_online_mask, hk_mask);
 
 	return fsl_mc_driver_register(&dpaa2_dpio_driver);
 }

-- 
2.51.0


      parent reply	other threads:[~2026-09-30 16:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-30 16:54 [PATCH RFC net-next 0/3] dpaa2: avoid scheduling dpio interrupts on isolated CPUs Josua Mayer
2026-09-30 16:54 ` [PATCH RFC net-next 1/3] dpaa2-eth: skip isolated CPUs when allocating channels Josua Mayer
2026-09-30 16:54 ` [PATCH RFC net-next 2/3] crypto: caam/qi2 - skip isolated CPUs when setting up queue pairs Josua Mayer
2026-09-30 16:55 ` Josua Mayer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260930-dpaa2-isolcpus-v1-3-66c13f4fd75b@solid-run.com \
    --to=josua@solid-run.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=chleroy@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gaurav.jain@nxp.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=horia.geanta@nxp.com \
    --cc=ioana.ciornei@nxp.com \
    --cc=jon@solid-run.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pankaj.gupta@nxp.com \
    --cc=yazan.shhady@solid-run.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®