From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5A473C43602 for ; Tue, 7 Jul 2026 09:49:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Qs3A+LONAtni+h8Qp1wmlltG03uWEkxp59/Fd3Ox+rE=; b=XJd71oNgNkcsgJP7NPjzE1FN/i JR8esMlsdN9OvPWlkVEiqEPALG/rqeIfTf6ReZlAsWPTZk4OlHBojEG4V8txe+8Fc3eejD3MmJIXb uDuni9XExLI6YFZlW+Pl9tPZxz4uNXcyp8ziFNC84ZIWp25TQZ4TxwbPk5LCKCrqj0FGTc6ki79kA 1s3rIAVgpOkl2IpetozWPK8HupbQsZTSKxAl+/Ktyv+D9lSmA27KAwjDYEk/aNc4kQ7sJYF+fKHih gVPwBWaaMTjStX7K4Ke/Absi47Lzg5Dql2wh+4rCNnakrNNrsLTESney9tpHQ8LKJFK4Nidrtw6eG 76BnPKUw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wh2QE-0000000Ef7S-3aZx; Tue, 07 Jul 2026 09:48:58 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wh2QB-0000000Ef6n-3LkL for linux-arm-kernel@lists.infradead.org; Tue, 07 Jul 2026 09:48:57 +0000 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-493b7612475so37121055e9.3 for ; Tue, 07 Jul 2026 02:48:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=riscstar-com.20251104.gappssmtp.com; s=20251104; t=1783417733; x=1784022533; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Qs3A+LONAtni+h8Qp1wmlltG03uWEkxp59/Fd3Ox+rE=; b=rWJquRdm8lLTA89moM2fsbPWmngKBDjJUb9dO5ZVd58iZyQ799rcvs8e+0U+OzHpAO 9J2OY+GcANTMHfFlvRqS3i2OHYCgzaRu0fvUe6W7vFl880jBDc/4QfbatAX/Xaw8pfLB dJjgByINFposrWHPmlxvPXzTsSekZGL+5//pvKyjfSWDfLs8qdxvRL2yVrWsN5NTXLhs sP21OXsRZ+yw1R4FxZ8HGY9Ud101yzi3Yfd+unKJFwtQBG4W4mEp5uZ3kEtvsI8J1Rt+ fc95XO2Qxr4EQ4ehvvPLpSkdIYcFLWzas14zSg+6sG0l3ZQFhRHxlg4FexGQ2eY09Pdu pSsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783417733; x=1784022533; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Qs3A+LONAtni+h8Qp1wmlltG03uWEkxp59/Fd3Ox+rE=; b=pR0pSc45UZR850UuDU3bidBpsI6F6urQhMR9GIBJ18+T9ubJJbsi19zU3t1DhXWYGD druHk061pag5hApm2t4UfUbSjOPvN9wqgdbRC8NXUZHLXX8IADx1qU2ePuw37B0a6uYC D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ihroA== X-Received: by 2002:a05:600c:8b67:b0:493:bd2f:c5dd with SMTP id 5b1f17b1804b1-493df08c35dmr46181645e9.21.1783417733495; Tue, 07 Jul 2026 02:48:53 -0700 (PDT) Received: from aspen.lan (aztw-34-b2-v4wan-166919-cust780.vm26.cable.virginm.net. [82.37.195.13]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-493e0078d49sm47904175e9.0.2026.07.07.02.48.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jul 2026 02:48:52 -0700 (PDT) Date: Tue, 7 Jul 2026 10:48:50 +0100 From: Daniel Thompson To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Alexandre Torgue , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Stanislav Fomichev Cc: Alex Elder , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org Subject: Re: [PATCH] net: stmmac: Avoid freeing and re-requesting IRQ during XDP set prog Message-ID: References: <20260706-tc956x-stmmac-no_irq_teardown-v1-1-df009d0272bf@riscstar.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260706-tc956x-stmmac-no_irq_teardown-v1-1-df009d0272bf@riscstar.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260707_024856_123617_5BFC437A X-CRM114-Status: GOOD ( 18.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jul 06, 2026 at 05:17:58PM +0100, Daniel Thompson wrote: > Currently stmmac will run a full cycle of IRQ tear down and setup when > setting up a new XDP program. This makes tuning TSN systems difficult > because whenever a new XDP program is installed then the irq threads will > be stopped and restarted which will undo any thread tuning. > > The problem is avoided by removing stmmac_free_irq()/stmmac_request_irq() > from stmmac_xdp_release()/stmmac_xdp_open(). > > stmmac_free_irq() implicitly synchronizes interrupts and, with that > removed, I was unable to prove that later actions in > stmmac_xdp_release() are safe when there are concurrent interrupts. To > avoid problems let's also move the code to disable DMA interrupts earlier > in the sequence and explicitly sync the interrupts handler(s). > > Signed-off-by: Daniel Thompson > > @@ -7156,10 +7201,8 @@ int stmmac_xdp_open(struct net_device *dev) > stmmac_reset_queues_param(priv); > > /* DMA CSR Channel configuration */ > - for (chan = 0; chan < dma_csr_ch; chan++) { > + for (chan = 0; chan < dma_csr_ch; chan++) > stmmac_init_chan(priv, priv->ioaddr, priv->plat->dma_cfg, chan); > - stmmac_disable_dma_irq(priv, priv->ioaddr, chan, 1, 1); > - } Sashiko picked up that stmmac_init_chan() has the effect of enabling DMA irqs, making this code unsafe. Given stmmac_xdp_open() can only be called on a running interface (and that stmmac_xdp_open() explicitly sets sph) then re-initializing with stmmac_init_chan() should have no effect and we can drop that as well. I'll double check with a code review across all the dwmac versions before pushing out a v2! Daniel.