From patchwork Sat Sep 26 15:49:01 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Hilliard X-Patchwork-Id: 3478 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mxe881.netcup.net (Postfix) with ESMTPS id B6FE11C5FAB for ; Sat, 26 Sep 2026 17:56:02 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=gmail.com; spf=pass (sender IP is 172.234.253.10) smtp.mailfrom=linux-sunxi+bounces-26272-noreply=patchwork.local@lists.linux.dev smtp.helo=sea.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.234.253.10 as permitted sender) client-ip=172.234.253.10; envelope-from=linux-sunxi+bounces-26272-noreply=patchwork.local@lists.linux.dev; helo=sea.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sea.lore.kernel.org (Postfix) with ESMTP id 2BD52333D4 for ; Sat, 26 Sep 2026 15:50:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0379D36D9E0; Sat, 26 Sep 2026 15:49:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Q1DFBLmE" X-Original-To: linux-sunxi@lists.linux.dev Received: from mail-oo2-f42.google.com (mail-oo2-f42.google.com [74.125.231.170]) (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 1CEAD377558 for ; Sat, 26 Sep 2026 15:49:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.231.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790437780; cv=none; b=YPHVkkbvGvdqfC779hBGBICA5GSNUUM6T1q9MvkY7pWIiQLj5zaIkHnYaZbnaLR6VvNFI63TkMUqGxRDXCtL2jO50/C+0pA7rBLSYFHrlCqPzpn5ugEG0MuLxXqHFwBl/6Lux3m4lyeHh2UAxJY7XTksv5x8dm7Qe2qLPxrlRFo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790437780; c=relaxed/simple; bh=Fs1fLcJcakNPYti2xesmjolkKKjRCOnYepmgSWO4EZk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Ojd8wysnltYaJReV18FD5ku9lrDhJPK637FGoFGNo9E7ohD7ZkHWQBY+Y/klJaqhJU3inuDUWrFbc0FqB+kIyjyQmxzrXxUoN5LMr0597r19oS0D2kAwEX07GOk8j5+suSZRGWiXnKsl85HWepp1R4MRYgkHIl9IAtuWEg3SzlA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Q1DFBLmE; arc=none smtp.client-ip=74.125.231.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oo2-f42.google.com with SMTP id 006d021491bc7-6d797cfdd5fso186809eaf.2 for ; Sat, 26 Sep 2026 08:49:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1790437772; x=1791042572; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=XgjZN8ALEfDluGPl+zvIInMEXTqsuH7e7EhuIKCn+Ic=; b=Q1DFBLmEy3UUjuWvXJ2UbRiR5HAdtiNIfUx4eNR0OQGYBG1kWqBgdgBw4Qc5zEwu+0 kopyz+33piBTxz82TFBWWENowLYrLyl+2WmGXvAGHupIxyGf5wPMEDebcUaqrJ9yKP1W rYlqybhLOGtSOwlvvHniM/eb+hyYWD1VHr+EuNoSA7rwgVQXfmINTQsBG3BPf18O63iZ pG4YF+Xa2OsuQcf7dv/xBkPtjnv8n0eZh2VqVbrieBOMUlC5v2PKtRuDapxO3NrM/RER 4+9grDhyVjllDxTMLUn7IrZG1evRGQ7qdIepKIj0UyhSq0wkiAMga/zfepUlGP3i8bAo YpCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790437772; x=1791042572; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=XgjZN8ALEfDluGPl+zvIInMEXTqsuH7e7EhuIKCn+Ic=; b=ACA0YpiXqUovv44nLRe7YNqQGdMz/4+OW4BOV0H7QEkDNg355cQLKdAde8ksBiB/tz SI6kCoVDnAk03pTLsCOKItKwT//4wxDzSVHfyF9u/Wa0N5YnjV7dDwXTeYYUGamhzPFw fdyHsO69XeToe8uaDn1z0wIkWdkeV2ZZUYfT6yk4fNBCIlm9WaVrNFjjWLKsH8OfU+8b 8bsYqB2Fmx2c2euNYaLSTEmti+g5CCxQ9sxhId0E2R6Xo2RWEYBFASBSSSYQ/BHZ2Pqv wqU3XDSDGnyD6JnPDI/V9ouj3sV3SQnZizZeOxxtjPOivIPOIEBJ/3GsMtdj1RGcM5S2 uSsA== X-Forwarded-Encrypted: i=1; AKwUvBxblayHaJqv5MbZrIw1812nehoHB4D5iffS0sZbeF+6ZNKCQKZ10aziB0npaKh2IahsH+Az+2IXMujzXg==@lists.linux.dev X-Gm-Message-State: AFuF++kPiydcspicUUKmTCmTmT4BzkHeLGlkUYUXOFTuHu/eOoG1fDu2 BGQdAmN/5PCH1Nz4n23P44mRLCuVQVu40va5JLWSkqcTK1sA3dWlGjL+ X-Gm-Gg: AYBFou2iQSilbtBmf3vBx8rrz0L9Ekz74ufLivJfCLezctIpN5A1U1p2UUqkYK8UN5t f0V4Un6ip1kjlOA7n76C/rX4mVwcfGpdMxf8qmk/CrvBTE7JlsAWsP7tYNI3sNeT+XBhLEjrhLe p16NMJGhuXaXYjZGJ7O1il1mFRL3uSft0Z7wZm5wIzQHMa6c3C7OIcNQGlvedtj2UPTUnEvTvQa GwEn/XT7/+2q0n4vulo6NIccUQOdRg4M5nTeuryhO3IYT2ZPuYyiI7ECkuY2lz1x/C6BBVnr4gc 27+7TuN08Zc1AdK/cd0YQuEItRvXPSnBtql8OK8PTQvBSQIwFl3zzJlev5AgnZKHcnWYoXbUz8n AQnmSyEExNqAuumuEQ13YeyHSlsx3WcUm+gvOmfjqr7MWbjGoc6BeTwCFzSto/nGKicBemKocDn 1BrfdIbbxcxtUarY5TVWXLOlyaMxFfdc9ytktnRAdA6bxI7VfRlyd3ihESZyL8bMi5JxlAars0G ursH7CJuIegbR2+58iMFNQkmo8VfAigM5Q17owP8q/r2gBboBO5cRdNZ7aEkl0oASozJDqC2Z+b VGQh+t/fS7wJjQuXNqQsQM4mzMZ7JMoqgsbzyTeULcgbls+wouLrUo1esrGwgg3RiMg1hn9WpzH AYxrX+rH315G43i/AkgUNo13dEVnzOFA= X-Received: by 2002:a05:6820:f02d:b0:6b4:117e:543 with SMTP id 006d021491bc7-6d43f7a6d39mr9544686eaf.21.1790437771939; Sat, 26 Sep 2026 08:49:31 -0700 (PDT) Received: from [127.0.1.1] (174-29-1-49.hlrn.qwest.net. [174.29.1.49]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-818e98b16d4sm5442366a34.26.2026.09.26.08.49.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Sep 2026 08:49:31 -0700 (PDT) From: James Hilliard Date: Sat, 26 Sep 2026 09:49:01 -0600 Subject: [PATCH net v4 06/15] net: stmmac: leave the datapath running for normal-size MTU changes Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260926-submit-stmmac-reset-fixes-v1-v4-6-ec1c0250b3c9@gmail.com> References: <20260926-submit-stmmac-reset-fixes-v1-v4-0-ec1c0250b3c9@gmail.com> In-Reply-To: <20260926-submit-stmmac-reset-fixes-v1-v4-0-ec1c0250b3c9@gmail.com> To: Russell King , Andrew Lunn , Heiner Kallweit , "David S. Miller" , Jakub Kicinski , Paolo Abeni , Joakim Zhang , "Russell King (Oracle)" , Maxime Chevallier , Andrew Lunn , Maxime Coquelin , Alexandre Torgue , Christian Marangi , Tiezhu Yang , Huacai Chen , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Stanislav Fomichev , Serge Semin , Suraj Jaiswal , Richard Cochran , Joao Pinto , Vladimir Oltean , Ong Boon Leong , Voon Weifeng , "Song, Yoong Siang" , Linus Walleij , Martin Blumenstingl , Magnus Karlsson , Maciej Fijalkowski , Simon Horman , =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , Thierry Reding , Jonathan Hunter , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Eric Dumazet Cc: Richard Genoud , Alastair D'Silva , Maxime Ripard , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, bpf@vger.kernel.org, ZhaoJinming , Lorenzo Bianconi , Ding Hui , James Hilliard , linux-tegra@vger.kernel.org, linux-sunxi@lists.linux.dev X-Mailer: b4 0.15.2 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Changing an MTU at or below ETH_DATA_LEN does not change the receive buffer size or the MAC receive limit when the previous MTU was also in that range. Do not release and reopen the datapath for those changes. Besides avoiding unnecessary hardware resets and their failure paths, this keeps live AF_XDP pool bindings intact. Preparing replacement rings before stopping the old rings otherwise binds the pool to a temporary RXQ and consumes fill-ring entries while its current RXQ is still active. XDP already rejects jumbo MTUs, so all supported live XDP MTU changes can use this path without preparing replacement rings. Keep jumbo transitions on the existing reinitialization path for now. The later ownership and rollback changes address that path separately. Fixes: 3470079687448 ("net: ethernet: stmicro: stmmac: permit MTU change with interface up") Signed-off-by: James Hilliard --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 8b0bc7c46df9..bdebc5bfa2b8 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -6166,7 +6166,12 @@ static int stmmac_change_mtu(struct net_device *dev, int new_mtu) if ((txfifosz < new_mtu) || (new_mtu > BUF_SIZE_16KiB)) return -EINVAL; - if (netif_running(dev)) { + /* Normal-size frames use the same buffers and MAC receive limits. + * In particular, do not disturb a live AF_XDP pool: XDP does not + * support jumbo frames, so it never needs the ring replacement below. + */ + if (netif_running(dev) && + (dev->mtu > ETH_DATA_LEN || mtu > ETH_DATA_LEN)) { netdev_dbg(priv->dev, "restarting interface to change its MTU\n"); /* Try to allocate the new DMA conf with the new mtu */ dma_conf = stmmac_setup_dma_desc(priv, mtu);