From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2F17C3D5C07 for ; Tue, 7 Jul 2026 09:48:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783417736; cv=none; b=bGz3t7+bqrRLDpLYUK8F/nI8cVxEcd0kV+hxxEkkPZb4eYvud+ZLbTaQMM/ZNeMEjOjOTQihMEB5WtNZQeKZvznPRk5ijpWL57A2NdwndRMToGOHAPz1BsXAPQD+HkJqU3zoIzIA12cvYe3C4TStdWfkX615jkVTa9am2wUsmCY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783417736; c=relaxed/simple; bh=dxErGz/gtuJMMd0ZCUwsU0QRw3tKi/SSEtrZ2mEv2ZM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=VHWd4dQx9sKcc/vCfFtnNNoKrZJtmHJCovGontJJSw4/2PYU5N7iV3AJ0+Jx5JhrgYJxbyv+tEqZroYYfh5ofbXodlzle66w0F0zNM36iu90nZoqKRTAcxPVai8uWdsLeY/rIAFtUjGsMJL4TBc+mIM/esHhjx3XqUMEzVAA6qY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com; spf=pass smtp.mailfrom=riscstar.com; dkim=pass (2048-bit key) header.d=riscstar-com.20251104.gappssmtp.com header.i=@riscstar-com.20251104.gappssmtp.com header.b=WmmDCAQc; arc=none smtp.client-ip=209.85.128.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=riscstar.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=riscstar.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=riscstar-com.20251104.gappssmtp.com header.i=@riscstar-com.20251104.gappssmtp.com header.b="WmmDCAQc" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-493b7612475so37121045e9.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=vger.kernel.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=WmmDCAQcONqxk8QJsEcXqFwhg5sYGEf8xrpamiqLkwYdRbxOBRrJN/i29BzoAXcTgS k5hXvOuvttmuf2y7ZHOViUajJuhaMkyUBDWR8eg537kXOx/1jz3tuhX0ifR88nk2tJ+b l9WQNxWWuUIv3OFmvIrIpcqAo5LyInMH1s0WBaSzBD9/UMuiTDXrF40U7uP3FpFT4bLI AHSp0whB9b9JMnJW4L7eYN4Xgmh6NdnDe73jLVji6bS6JBMlSMQh04uNMmuverWCfw99 JXr8HgmQOS6ah49YklfN+e0+QNbBDQuVpHn2e4hprBvTK+1iHWg1gEJy5vjEdHG9Q3i7 aQ0g== 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=EyTPHu8A6SWghI5j7BYzrhhjoKP/BXmadlcHPNuJ4rUpemLP8yD8MVu4E4wv/9Wq+U 7LBxNpXe7FjfDHdTnCGgoCub3RH4VEpE68x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luPjbTWZXHBgZa0xA== 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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> 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.